Merge pull request #6926 from mozilla/issue-6924-change-password-tests r=@vladikoff

fix(test): Fix the change password tests.
This commit is contained in:
Shane Tomlinson 2019-02-04 16:30:51 +00:00 коммит произвёл GitHub
Родитель aba807f660 ce5b867067
Коммит 5ecc201a6f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 13 добавлений и 6 удалений

Просмотреть файл

@ -28,6 +28,7 @@ const {
noSuchElementDisplayed,
noSuchElement,
openPage,
pollUntilHiddenByQSA,
testElementExists,
testElementTextEquals,
thenify,
@ -106,24 +107,30 @@ registerSuite('change_password', {
.then(setupTest())
.then(click(selectors.CHANGE_PASSWORD.MENU_BUTTON))
// new_password empty
.then(fillOutChangePassword(FIRST_PASSWORD, '', { expectSuccess: false, vpassword: SECOND_PASSWORD }))
.then(type(selectors.CHANGE_PASSWORD.OLD_PASSWORD, FIRST_PASSWORD))
.then(type(selectors.CHANGE_PASSWORD.NEW_PASSWORD, ''))
.then(click(selectors.CHANGE_PASSWORD.SUBMIT))
.then(testElementExists(selectors.CHANGE_PASSWORD.PASSWORD_BALLOON.MIN_LENGTH_FAIL))
// new_password too short
.then(fillOutChangePassword(FIRST_PASSWORD, 'pass', { expectSuccess: false, vpassword: SECOND_PASSWORD }))
.then(type(selectors.CHANGE_PASSWORD.NEW_PASSWORD, 'pass'))
.then(testElementExists(selectors.CHANGE_PASSWORD.PASSWORD_BALLOON.MIN_LENGTH_FAIL))
// new_password too close to the email address
.then(fillOutChangePassword(FIRST_PASSWORD, email, { expectSuccess: false, vpassword: SECOND_PASSWORD }))
.then(type(selectors.CHANGE_PASSWORD.NEW_PASSWORD, email))
.then(testElementExists(selectors.CHANGE_PASSWORD.PASSWORD_BALLOON.NOT_EMAIL_FAIL))
// new_password too common
.then(fillOutChangePassword(FIRST_PASSWORD, 'password', { expectSuccess: false, vpassword: SECOND_PASSWORD }))
.then(type(selectors.CHANGE_PASSWORD.NEW_PASSWORD, 'password'))
.then(testElementExists(selectors.CHANGE_PASSWORD.PASSWORD_BALLOON.NOT_COMMON_FAIL))
// all good
.then(fillOutChangePassword(FIRST_PASSWORD, SECOND_PASSWORD));
.then(type(selectors.CHANGE_PASSWORD.NEW_PASSWORD, SECOND_PASSWORD))
.then(type(selectors.CHANGE_PASSWORD.NEW_VPASSWORD, SECOND_PASSWORD))
.then(click(selectors.CHANGE_PASSWORD.SUBMIT))
.then(pollUntilHiddenByQSA(selectors.CHANGE_PASSWORD.DETAILS));
},
'new_vpassword validation, tooltip shows': function () {

Просмотреть файл

@ -42,7 +42,7 @@ var email;
var setupTest = thenify(function (shouldVerifySignin) {
return this.parent
.then(createUser(email, FIRST_PASSWORD, { preVerified: true }))
.then(clearBrowserState())
.then(clearBrowserState({ force: true }))
.then(openPage(SIGNIN_URL, '#fxa-signin-header'))
.execute(listenForFxaCommands)
.then(fillOutSignIn(email, FIRST_PASSWORD))