Skip to content
This repository has been archived by the owner on Feb 18, 2021. It is now read-only.

Try to make #changeToNewRole a bit more reliable #1013

Closed
wants to merge 1 commit into from
Closed
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
12 changes: 9 additions & 3 deletions lib/pages/edit-team-member-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,15 @@ export default class EditTeamMemberPage extends BaseContainer {
}

changeToNewRole( roleName ) {
DriverHelper.clickWhenClickable( this.driver, By.css( `select#roles option[value=${roleName}]` ) );
DriverHelper.clickWhenClickable( this.driver, By.css( 'button.form-button.is-primary' ) );
return this.driver.wait( until.elementLocated( By.css( '.is-success' ) ), this.explicitWaitMS, 'Could not locate the success message' );
const roleSelector = By.css( `select#roles option[value=${roleName}]` );
const buttonSelector = By.css( '.edit-team-member-form__form button:not([disabled])' );

return DriverHelper.clickWhenClickable( this.driver, roleSelector )
.then( () => DriverHelper.clickWhenClickable( this.driver, buttonSelector ) )
.then( () => this.driver.wait(
until.elementLocated( By.css( '.people-notices__notice.is-success' ) ),
this.explicitWaitMS,
'Could not locate the success message' ) );
}

successNoticeDisplayed() {
Expand Down