Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Maintenance #4699

Merged
merged 8 commits into from
Mar 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion e2e/config/wdio.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ exports.config = {
connectionRetryTimeout: 90000,
//
// Default request retries count
connectionRetryCount: 3,
connectionRetryCount: 10,
//
// Initialize the browser instance with a WebdriverIO plugin. The object should have the
// plugin name as key and the desired plugin options as properties. Make sure you have
Expand Down
3 changes: 2 additions & 1 deletion e2e/pageobjects/linode-detail/linode-detail-rebuild.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class Rebuild extends Page {
get imageOptions() { return $$(this.imageOption.selector); }
get imageError() { return $(`${this.imageSelectSelector}>p`); }
get rebuildDescriptionText() { return $('[data-qa-rebuild-desc]'); }
get rebuildConfirmModalButton() { return $('[data-qa-submit-rebuild]') }

assertElemsDisplay() {
this.rebuildDescriptionText.waitForVisible(constants.wait.normal);
Expand All @@ -35,8 +36,8 @@ class Rebuild extends Page {
}

rebuild() {
const toastMessage = 'Linode rebuild started.';
browser.jsClick(this.submit.selector);
browser.jsClick(this.rebuildConfirmModalButton.selector)
this.toastDisplays('Linode rebuild started');
}
}
Expand Down
9 changes: 5 additions & 4 deletions e2e/pageobjects/linode-detail/linode-detail-settings.page.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { constants } = require('../../constants');
const {
generatePassword,
getDistrobutionLabel,
getDistributionLabel
} = require('../../utils/common')

import Page from '../page';
Expand Down Expand Up @@ -82,7 +82,7 @@ class Settings extends Page {
imageSelect.waitForVisible(constants.wait.normal);
this.diskLabelInput.setValue(diskLabel);
imageSelect.click();
const displayImage = getDistrobutionLabel([imageId])[0];
const displayImage = getDistributionLabel([imageId])[0];
imageSelect.setValue(displayImage);
const imageSelection = `[data-qa-option="linode/${imageId}"]`;
$(imageSelection).waitForVisible(constants.wait.normal);
Expand Down Expand Up @@ -118,8 +118,9 @@ class Settings extends Page {
}

remove() {
const linodeLabel = browser.getText('[data-qa-label]');
const confirmTitle = 'Confirm Deletion';
/** linode label sourced from the editable text H1 in the header */
const linodeLabel = browser.getText('[data-qa-editable-text]');
const confirmTitle = `Confirm Deletion of ${linodeLabel}`;
const confirmContent = 'Deleting a Linode will result in permanent data loss. Are you sure?';
this.delete.click();
this.deleteDialogTitle.waitForText();
Expand Down
8 changes: 4 additions & 4 deletions e2e/pageobjects/linode-detail/linode-detail-volume.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ export class VolumeDetail extends Page {
}

detachVolume(volume, detach=true) {

this.selectActionMenuItem(volume, 'Detach');

const dialogTitle = $('[data-qa-dialog-title]');
Expand Down Expand Up @@ -389,10 +390,9 @@ export class VolumeDetail extends Page {
.map(volume => volume.getAttribute(attribute));
}

hoverVolumeTags(label, volId){
const id = volId ? volId : this.volumeRow(label).$('..').getAttribute(this.volumeCellElem.selector.slice(1,-1));
const selector = this.volumeCellElem.selector.replace(']','');
$(`${selector}="${id}"]>td:nth-child(2)`).moveToObject();
hoverVolumeTags(label) {
const volumeRow = this.volumeRow(label).$('..');
volumeRow.$(this.totalTags.selector).moveToObject();
}
}

Expand Down
7 changes: 4 additions & 3 deletions e2e/pageobjects/list-domains.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ class ListDomains extends Page {

baseElemsDisplay(placeholder) {
if (placeholder) {
const placeholderTitle = 'Add a Domain';
const placeholderTitle = 'Manage your Domains';
const buttonText = 'Add a Domain';
this.placeholderText.waitForVisible(constants.wait.normal);

expect(this.placeholderText.getText()).toBe(placeholderTitle);
expect(this.createButton.getText()).toBe(placeholderTitle);
expect(this.placeholderText.getText()).toMatch(placeholderTitle);
expect(this.createButton.getText()).toMatch(buttonText);
return this;
}

Expand Down
2 changes: 1 addition & 1 deletion e2e/pageobjects/list-stackscripts.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ListStackScripts extends Page {
get stackScriptRows() { return $$('[data-qa-table-row]'); }
get stackScriptTitle() { return $('[data-qa-stackscript-title]'); }
get stackScriptDeploys() { return $('[data-qa-stackscript-deploys]'); }
get stackScriptCompatibleDistrobutions() { return $('[data-qa-stackscript-images]'); }
get stackScriptCompatibleDistributions() { return $('[data-qa-stackscript-images]'); }
get stackScriptActionMenu() { return $('[data-qa-action-menu]'); }
get stackScriptActionMenuLink() { return $('[data-qa-action-menu-link]'); }
get stackScriptRevision() { return $('[data-qa-stackscript-revision]'); }
Expand Down
15 changes: 9 additions & 6 deletions e2e/pageobjects/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export default class Page {
get tags() { return $$('[data-qa-tag]'); }
get addTag() { return $('[data-qa-add-tag]'); }
get deleteTag() { return $('[data-qa-delete-tag]'); }
get totalTags() { return $('[data-qa-total-tags]'); }
get helpButton() { return $('[data-qa-help-button]'); }
get tagsMultiSelect() { return $('[data-qa-multi-select="Type to choose or create a tag."]'); }
get popoverMsg() { return $('[role="tooltip"]'); }
Expand Down Expand Up @@ -165,19 +166,21 @@ export default class Page {
}

openActionMenu(actionMenuRow) {
actionMenuRow.$(this.actionMenu.selector).waitForVisible(constants.wait.normal);
browser.waitForVisible(`${actionMenuRow.selector} ${this.actionMenu.selector}`, constants.wait.normal);
// actionMenuRow.$(this.actionMenu.selector).waitForVisible(constants.wait.normal);
try {
actionMenuRow.$(this.actionMenu.selector).click();
browser.waitUntil(() => {
return $$('[data-qa-action-menu-item]').length > 0;
},constants.wait.normal);
}, constants.wait.normal, "Menu items failed to show up");
} catch (e) {
if ( e.Error ){
actionMenuRow.$(this.actionMenu.selector).click();
/* Our attempt clicking the action menu bombed, most likely because some
// Element in the UI is covering it. JS Click to force the click instead
*/
browser.jsClick(`${actionMenuRow.selector} ${this.actionMenu.selector}`);
browser.waitUntil(() => {
return $$('[data-qa-action-menu-item]').length > 0;
},constants.wait.normal);
}
}, constants.wait.normal, "Menu items failed to show up");
}
}

Expand Down
4 changes: 2 additions & 2 deletions e2e/pageobjects/stackscripts/stackscript-detail.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ class StackScriptDetail extends Page {
return $(`${selector}="${stackScriptAuthor}"]`);
}

getStackScriptCompatibleDisrobutions(){
this.compatibleDistrobutions.waitForVisible(constants.wait.normal);
getStackScriptCompatibleDistributions(){
this.compatibleDistributions.waitForVisible(constants.wait.normal);
const distroListText = this.compatibleDistributions.getText();
const cleanText = distroListText.replace('Compatible with: ','');
return cleanText.split(',').map(distro=> distro.trim());
Expand Down
1 change: 1 addition & 0 deletions e2e/specs/domains/smoke-list-domains.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ describe('Domains - List Suite', () => {
browser.jsClick(`${domainElement} [data-qa-action-menu]`);

const expectedMenuItems = [
'Edit',
'Clone',
'Remove',
'Edit DNS Records',
Expand Down
12 changes: 8 additions & 4 deletions e2e/specs/linodes/detail/create-volumes.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ describe('Linode Detail - Volumes Suite', () => {
const checkVolumeDetail = (testVolume,testLinode) => {
browser.url(constants.routes.volumes);
browser.pause(750);

VolumeDetail.volumeCellElem.waitForVisible(constants.wait.normal);
let trimSelector = VolumeDetail.volumeAttachment.selector.replace(']','')
const linodeAttachedToCell = `${trimSelector}="${testLinode}"]`;
Expand All @@ -60,7 +61,7 @@ describe('Linode Detail - Volumes Suite', () => {
VolumeDetail.selectActionMenuItemV2(VolumeDetail.volumeCellElem.selector, 'Detach');
VolumeDetail.confirmDetachORDelete();
VolumeDetail.createButton.waitForVisible(constants.wait.long);
expect(VolumeDetail.placeholderText.getText()).toBe('Create a Volume');
expect(VolumeDetail.placeholderText.getText()).toMatch('Add Block Storage');
}

beforeAll(() => {
Expand All @@ -83,7 +84,7 @@ describe('Linode Detail - Volumes Suite', () => {
});

it('should display placeholder text and add a volume button', () => {
expect(VolumeDetail.placeholderText.getText()).toBe('Create a Volume');
expect(VolumeDetail.placeholderText.getText()).toMatch('Add Block Storage');
expect(VolumeDetail.createButton.isVisible()).toBe(true);
});

Expand Down Expand Up @@ -197,8 +198,11 @@ describe('Linode Detail - Volumes Suite', () => {


it('volume created successfully with tag', () => {

expect(VolumeDetail.volumeCellLabel.getText()).toContain(testVolume.label);
expect(VolumeDetail.volumeCellSize.getText()).toContain(testVolume.size);

VolumeDetail.hoverVolumeTags(testVolume.label);
VolumeDetail.checkTagsApplied([testVolume.tags]);
});

Expand All @@ -215,7 +219,7 @@ describe('Linode Detail - Volumes Suite', () => {
});
});

describe('Attach Existing Volume - Detatch Volume', () => {
describe('Attach Existing Volume - Detach Volume', () => {

it('can attach an existing volume', () => {
VolumeDetail.createButton.click();
Expand All @@ -224,7 +228,7 @@ describe('Linode Detail - Volumes Suite', () => {
});

it('volume attached successfully', () => {
VolumeDetail.volumeCellElem.waitForVisible(constants.wait.normal);
VolumeDetail.volumeCellElem.waitForVisible(constants.wait.long);
expect(VolumeDetail.volumeCellLabel.getText()).toContain(volumeEast.label);
expect(VolumeDetail.volumeCellSize.getText()).toContain('20');
});
Expand Down
8 changes: 6 additions & 2 deletions e2e/specs/linodes/detail/rebuild.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ describe('Linode Detail - Rebuild Suite', () => {
Rebuild.rebuildSelect.click();
browser.pause(500);
const rebuildOptions = Rebuild.selectOptions.map(options => options.getText());
expect(rebuildOptions.sort()).toEqual(['From Image','From StackScript']);
expect(rebuildOptions.sort()).toEqual(['From Image', 'From StackScript']);
$('body').click();
});

it('should display error on create an image without selecting an image', () => {
Rebuild.submit.click();
browser.waitForVisible(Rebuild.rebuildConfirmModalButton.selector)
Rebuild.rebuildConfirmModalButton.click();
Rebuild.waitForNotice('An image is required.', constants.wait.normal);
browser.refresh();
Rebuild.assertElemsDisplay();
Expand All @@ -48,8 +50,10 @@ describe('Linode Detail - Rebuild Suite', () => {
it('should display error on create image without setting a password', () => {
const errorMsg = 'Password cannot be blank.';
Rebuild.selectImage();
Rebuild.imageOption.waitForVisible(constants.wait.normal,true);
Rebuild.imageOption.waitForVisible(constants.wait.normal, true);
Rebuild.submit.click();
browser.waitForVisible(Rebuild.rebuildConfirmModalButton.selector)
Rebuild.rebuildConfirmModalButton.click();
Rebuild.waitForNotice(errorMsg, constants.wait.normal);
browser.refresh();
Rebuild.assertElemsDisplay();
Expand Down
2 changes: 1 addition & 1 deletion e2e/specs/linodes/detail/resize.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('Linode Detail - Resize Suite', () => {
});

it('should display toast message on resize', () => {
const toastMsg = 'Linode resize started.';
const toastMsg = 'Linode queued for resize.';

Resize.planCards[1].click();
browser.waitUntil(() => {
Expand Down
26 changes: 14 additions & 12 deletions e2e/specs/profile/tokens.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ describe('View - Personal Access Tokens', () => {

describe('Create - Personal Access Tokens', () => {
it('should display create drawer on create', () => {
/** opens the create drawer */
profile.create('token');

tokenCreateDrawer.baseElemsDisplay();
tokenCreateDrawer.labelTimestamp(timestamp);

Expand Down Expand Up @@ -60,7 +62,7 @@ describe('View - Personal Access Tokens', () => {
const sixMonths = new Date();
sixMonths.setMonth(now.getMonth() + 6);
sixMonths.setDate(sixMonths.getDate());
browser.waitForVisible(token)
browser.waitForVisible(newToken)
// $(newToken).waitForVisible();
expect(browser.getText(`${newToken} [data-qa-token-expiry]`)).toContain(sixMonths.toISOString().slice(0,8));
});
Expand All @@ -71,10 +73,9 @@ describe('View - Personal Access Tokens', () => {
});

it('should display token scopes drawer', () => {
browser.click(`${newToken} [data-qa-action-menu]`);
browser.click('[data-qa-action-menu-item="View Token Scopes"]');
profile.selectActionMenuItem($(newToken), 'View Token Scopes');

browser.waitForVisible('[data-qa-row="Account"]');
browser.waitForVisible('[data-qa-row="Account"]', constants.wait.normal);
browser.waitForVisible('[data-qa-close-drawer]');

const accountPermission = $('[data-qa-row="Account"] [data-qa-perm-rw-radio]');
Expand All @@ -88,19 +89,18 @@ describe('View - Personal Access Tokens', () => {
expect(imagesPermission.getAttribute('data-qa-perm-rw-radio')).toBe('true');

browser.click('[data-qa-close-drawer]');

browser.waitForVisible('[data-qa-close-drawer]', constants.wait.normal, true);
browser.waitForExist('[data-qa-drawer]', constants.wait.normal, true);
});

describe('Edit - Personal Access Tokens', () => {
it('should display edit drawer', () => {
profile.selectActionMenuItem($(newToken), 'Rename Token')
browser.waitForVisible(`${newToken} [data-qa-action-menu]`, constants.wait.normal)
profile.selectActionMenuItem($(newToken), 'Rename Token');


expect(tokenCreateDrawer.label.waitForVisible()).toBe(true);
browser.waitForVisible(tokenCreateDrawer.label.selector, constants.wait.normal)
expect(tokenCreateDrawer.title.getText()).toBe('Edit Personal Access Token');
expect(tokenCreateDrawer.submit.isVisible()).toBe(true);
expect(tokenCreateDrawer.cancel.isVisible()).toBe(true);
browser.waitForVisible(tokenCreateDrawer.submit.selector, constants.wait.normal)
browser.waitForVisible(tokenCreateDrawer.cancel.selector, constants.wait.normal)
});

it('should update label on edit', () => {
Expand Down Expand Up @@ -139,7 +139,9 @@ describe('View - Personal Access Tokens', () => {
it('should revoke on remove', () => {
browser.click(dialogConfirm);
profile.tokenBaseElems();
browser.waitForVisible(updatedSelector, constants.wait.long, true);
/** we've revoked the token and it should not be visible */
browser.refresh();
browser.waitForVisible(updatedSelector, constants.wait.normal, true);
});
});
});
Expand Down
Loading