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

Sidm 3118 fix flapping tests #312

Merged
merged 5 commits into from
Jan 20, 2020
Merged
Show file tree
Hide file tree
Changes from 3 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
6 changes: 3 additions & 3 deletions codecept.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ exports.config = {
bootstrap: false,
helpers: {
Puppeteer: {
//show: true,
// show: true,
url: TestData.WEB_PUBLIC_URL,
waitForTimeout: 60000,
waitForAction: 100,
getPageTimeout: 90000,
waitForAction: 2000,
getPageTimeout: 20000,
chrome: {
//args: ["--proxy-server=" + process.env.PROXY_SERVER],
ignoreHTTPSErrors: true
Expand Down
2 changes: 1 addition & 1 deletion src/test/js/account_lockout_reset_password_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Scenario('@functional @unlock My user account is unlocked when I reset my passwo
I.fillField('#password2', 'Passw0rd1234');
I.click('Continue');
I.waitForText('Your password has been changed', 20, 'h1');
I.see('You can now sign in with your new password.')
I.see('You can now sign in with your new password.');
I.amOnPage(`${TestData.WEB_PUBLIC_URL}/users/selfRegister?redirect_uri=${TestData.SERVICE_REDIRECT_URI}&client_id=${serviceName}`);
I.click('Sign in to your account');
I.waitInUrl('/login', 180);
Expand Down
3 changes: 1 addition & 2 deletions src/test/js/dynamic_user_registration_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ Scenario('@functional Register User Dynamically', async (I) => {
I.fillField('#password1', TestData.PASSWORD);
I.fillField('#password2', TestData.PASSWORD);
I.click('Continue');
I.waitForText('Account created', 60, 'h1');
I.wait(2);
I.waitForText('Account created', 20, 'h1');
I.see('You can now sign in to your account.');
});
16 changes: 3 additions & 13 deletions src/test/js/mfa_e2e_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ Scenario('@functional @mfaLogin I am not able to login with MFA for the block po
I.fillField('#username', blockUserEmail);
I.fillField('#password', TestData.PASSWORD);
I.click('Sign in');
I.wait(10);
I.waitForText('Policies check failed', 10, 'h2');
}).retry(TestData.SCENARIO_RETRY_LIMIT);

Expand All @@ -104,50 +103,42 @@ Scenario('@functional @mfaLogin Validate verification code and 3 incorrect otp a
I.fillField('#username', mfaUserEmail);
I.fillField('#password', TestData.PASSWORD);
I.click('Sign in');
I.wait(10);
I.seeInCurrentUrl("/verification");
I.waitInUrl("/verification", 20);
I.waitForText('Verification required', 2, 'h1');

I.wait(10);
const otpCode = await I.extractOtpFromEmail(mfaUserEmail);

// empty field
I.fillField('code', '');
I.click('Submit');
I.wait(5);
I.waitForText('Enter a verification code', 5, '.error-message');
// other than digits
I.fillField('code', '663h8w7g');
I.click('Submit');
I.wait(3);
I.see('Enter numbers only');
// not 8 digit otp
I.fillField('code', `1${otpCode}`);
I.click('Submit');
I.wait(3);
I.see('Enter a valid verification code');
// invalid otp
I.fillField('code', '12345678');
I.click('Submit');
I.wait(3);
I.see('Verification code incorrect, try again');
// invalid otp
I.fillField('code', '74646474');
I.click('Submit');
I.wait(3);
I.see('Verification code incorrect, try again');

// invalid otp
I.fillField('code', '94837292');
I.click('Submit');
I.wait(5);
// after 3 incorrect attempts redirect user back to the sign in page
I.waitInUrl("/login", 20);
I.seeInCurrentUrl("/login");
I.see('Verification code check failed');
I.see('Your verification code check has failed, please retry');
I.fillField('#username', mfaUserEmail);
I.fillField('#password', TestData.PASSWORD);
I.click('Sign in');
I.wait(10);
I.seeInCurrentUrl('verification');
I.waitForText('Verification required', 2, 'h1');

Expand All @@ -156,7 +147,6 @@ Scenario('@functional @mfaLogin Validate verification code and 3 incorrect otp a
// previously generated otp should be invalidated
I.fillField('code', otpCode);
I.click('Submit');
I.wait(5);
I.waitForText('Verification code incorrect, try again', 5, '.error-message');
I.fillField('code', otpCodeLatest);
I.interceptRequestsAfterSignin();
Expand Down
1 change: 0 additions & 1 deletion src/test/js/policy_check_functional_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ Scenario('@functional @policy As a citizen with policies blocking me from login
I.fillField('#username', citizenEmail.toUpperCase());
I.fillField('#password', TestData.PASSWORD);
I.click('Sign in');
I.wait(10);
I.waitForText('Policies check failed', 10, 'h2');

}).retry(TestData.SCENARIO_RETRY_LIMIT);
17 changes: 3 additions & 14 deletions src/test/js/reset_password_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ BeforeSuite(async (I) => {
adminEmail = 'admin.' + randomData.getRandomEmailAddress();
citizenEmail = 'citizen.' + randomData.getRandomEmailAddress();
otherCitizenEmail = 'other.' + randomData.getRandomEmailAddress();
plusCitizenEmail = 'plus.' + "extra+" + randomData.getRandomEmailAddress();
plusCitizenEmail = 'plus.' + 'extra+' + randomData.getRandomEmailAddress();
shravanmechineni marked this conversation as resolved.
Show resolved Hide resolved
specialCharacterPassword = 'New&&&$$$%%%<>234';

const token = await I.getAuthToken();
Expand Down Expand Up @@ -68,7 +68,6 @@ Scenario('@functional @resetpass As a citizen user I can reset my password', asy
I.fillField('#password2', 'Passw0rd1234');
I.click('Continue');
I.waitForText('Your password has been changed', 20, 'h1');
I.wait(5);
I.see('You can now sign in with your new password.');
I.amOnPage(loginPage);
I.waitForText('Sign in or create an account', 20, 'h1');
Expand All @@ -88,7 +87,6 @@ Scenario('@functional @resetpasswithdiffcaseemail As a citizen user I can reset
I.waitForText('Sign in or create an account', 20, 'h1');
I.click('Forgotten password?');
I.waitForText('Reset your password', 20, 'h1');
I.wait(5);
I.fillField('#email', citizenEmail.toUpperCase());
I.click('Submit');
I.waitForText('Check your email', 20, 'h1');
Expand All @@ -101,7 +99,6 @@ Scenario('@functional @resetpasswithdiffcaseemail As a citizen user I can reset
I.fillField('#password2', 'Passw0rd1234');
I.click('Continue');
I.waitForText('Your password has been changed', 20, 'h1');
I.wait(5);
I.see('You can now sign in with your new password.');
I.amOnPage(loginPage);
I.waitForText('Sign in or create an account', 20, 'h1');
Expand Down Expand Up @@ -132,8 +129,7 @@ Scenario('@functional @resetpass As a citizen user with a plus email I can reset
I.fillField('#password2', 'Passw0rd1234');
I.click('Continue');
I.waitForText('Your password has been changed', 20, 'h1');
I.wait(5);
I.see('You can now sign in with your new password.')
I.see('You can now sign in with your new password.');
I.amOnPage(loginPage);
I.waitForText('Sign in or create an account', 20, 'h1');
I.fillField('#username', plusCitizenEmail);
Expand Down Expand Up @@ -163,30 +159,25 @@ Scenario('@functional @resetpass @passwordvalidation Validation displayed when I
I.fillField('password2', 'Passw0rd');
I.click('Continue');
I.waitForText('There was a problem with the password you entered', 20, 'h2');
I.wait(2);
I.see("Your password is too easy to guess");
I.fillField('password1', `${randomUserFirstName}Other6mKjmC`);
I.fillField('password2', `${randomUserFirstName}Other6mKjmC`);
I.click('Continue');
I.wait(2);
I.waitForText('There was a problem with the password you entered', 20, 'h2');
I.see("Do not include your name or email in your password");
I.fillField('password1', `${otherCitizenEmail}3ksTys`);
I.fillField('password2', `${otherCitizenEmail}3ksTys`);
I.click('Continue');
I.wait(2);
I.waitForText('There was a problem with the password you entered', 20, 'h2');
I.see("Do not include your name or email in your password");
I.fillField('password1', 'passwordidamtest');
I.fillField('password2', 'passwordidamtest');
I.click('Continue');
I.wait(2);
I.waitForText('There was a problem with the password you entered', 20, 'h2');
I.see('Your password didn\'t have all the required characters');
I.fillField('password1', 'Lincoln1');
I.fillField('password2', 'Lincoln1');
I.click('Continue');
I.wait(2);
I.waitForText('There was a problem with the password you entered', 20, 'h2');
I.see("Your password is too easy to guess");

Expand All @@ -197,7 +188,6 @@ Scenario('@functional @resetpass As a citizen user I can reset my password with
I.waitForText('Sign in or create an account', 20, 'h1');
I.click('Forgotten password?');
I.waitForText('Reset your password', 20, 'h1');
I.wait(10);
I.fillField('#email', citizenEmail);
I.click('Submit');
I.waitForText('Check your email', 20, 'h1');
Expand All @@ -209,9 +199,8 @@ Scenario('@functional @resetpass As a citizen user I can reset my password with
I.fillField('#password1', specialCharacterPassword);
I.fillField('#password2', specialCharacterPassword);
I.click('Continue');
I.wait(10);
I.waitForText('Your password has been changed', 20, 'h1');
I.see('You can now sign in with your new password.')
I.see('You can now sign in with your new password.');
I.amOnPage(loginPage);
I.waitForText('Sign in or create an account', 20, 'h1');
I.fillField('#username', citizenEmail);
Expand Down
17 changes: 0 additions & 17 deletions src/test/js/self_registration_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,34 +34,27 @@ Scenario('@functional @selfregister User Validation errors', (I) => {
I.waitInUrl('users/selfRegister', 180);
I.waitForText('Create an account or sign in', 20, 'h1');
I.see('Create an account');

I.click("Continue");

I.waitForText('Information is missing or invalid', 20, 'h2');
I.wait(5);
I.see('You have not entered your first name');
I.see('You have not entered your last name');
I.see('You have not entered your email address');
I.fillField('firstName', 'Lucy');
I.click('Continue');
I.wait(5);
I.dontSee('You have not entered your first name');
I.see('You have not entered your last name');
I.see('You have not entered your email address');
I.fillField('lastName', 'Lu');
I.click('Continue');
I.wait(5);
I.dontSee('You have not entered your first name');
I.dontSee('You have not entered your last name');
I.see('You have not entered your email address');
I.fillField('email', '111');
I.click('Continue');
I.wait(5);
I.see('Your email address is invalid');
I.fillField('firstName', 'L');
I.fillField('lastName', '@@');
I.click('Continue');
I.wait(5);
I.see('Your first name is invalid');
I.see('First name has to be longer than 1 character and should not include digits nor any of these characters:')
I.see('Your last name is invalid');
Expand Down Expand Up @@ -116,7 +109,6 @@ Scenario('@functional @selfregister I can self register', async (I) => {
I.fillField('#password2', TestData.PASSWORD);
I.click('Continue');
I.waitForText('Account created', 20, 'h1');
I.wait(5);
I.see('You can now sign in to your account.');
I.amOnPage(loginPage);
I.seeInCurrentUrl("state=selfreg");
Expand All @@ -125,7 +117,6 @@ Scenario('@functional @selfregister I can self register', async (I) => {
I.fillField('#password', TestData.PASSWORD);
I.interceptRequestsAfterSignin();
I.click('Sign in');
I.wait(10);
I.waitForText(TestData.SERVICE_REDIRECT_URI);
I.see('code=');
I.dontSee('error=');
Expand Down Expand Up @@ -164,7 +155,6 @@ Scenario('@functional @selfregister @prePopulatedScreen I can self register with
I.fillField('#password2', TestData.PASSWORD);
I.click('Continue');
I.waitForText('Account created', 20, 'h1');
I.wait(5);
I.see('You can now sign in to your account.');
I.amOnPage(loginPage);
I.seeInCurrentUrl("state=selfreg");
Expand Down Expand Up @@ -201,7 +191,6 @@ Scenario('@functional @selfregister I can self register with repeated special ch
I.fillField('#password2', specialCharacterPassword);
I.click('Continue');
I.waitForText('Account created', 20, 'h1');
I.wait(10);
I.see('You can now sign in to your account.');
I.amOnPage(loginPage);
I.seeInCurrentUrl("state=selfreg");
Expand All @@ -210,7 +199,6 @@ Scenario('@functional @selfregister I can self register with repeated special ch
I.fillField('#password', specialCharacterPassword);
I.interceptRequestsAfterSignin();
I.click('Sign in');
I.wait(10);
I.waitForText(TestData.SERVICE_REDIRECT_URI);
I.see('code=');
I.dontSee('error=');
Expand Down Expand Up @@ -238,30 +226,25 @@ Scenario('@functional @selfregister @passwordvalidation Validation displayed whe
I.fillField('password2', 'Passw0rd');
I.click('Continue');
I.waitForText('There was a problem with the password you entered', 20, 'h2');
I.wait(2);
I.see("Your password is too easy to guess");
I.fillField('password1', `${randomUserFirstName}Other6mKjmC`);
I.fillField('password2', `${randomUserFirstName}Other6mKjmC`);
I.click('Continue');
I.wait(2);
I.waitForText('There was a problem with the password you entered', 20, 'h2');
I.see("Do not include your name or email in your password");
I.fillField('password1', `${email}3ksTys`);
I.fillField('password2', `${email}3ksTys`);
I.click('Continue');
I.wait(2);
I.waitForText('There was a problem with the password you entered', 20, 'h2');
I.see("Do not include your name or email in your password");
I.fillField('password1', 'passwordidamtest');
I.fillField('password2', 'passwordidamtest');
I.click('Continue');
I.wait(2);
I.waitForText('There was a problem with the password you entered', 20, 'h2');
I.see('Your password didn\'t have all the required characters');
I.fillField('password1', 'Lincoln1');
I.fillField('password2', 'Lincoln1');
I.click('Continue');
I.wait(2);
I.waitForText('There was a problem with the password you entered', 20, 'h2');
I.see("Your password is too easy to guess");
}).retry(TestData.SCENARIO_RETRY_LIMIT);
8 changes: 0 additions & 8 deletions src/test/js/uplift_user_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,37 +52,31 @@ Scenario('@functional @upliftvalid User Validation errors', (I) => {
I.amOnPage(`${TestData.WEB_PUBLIC_URL}/login/uplift?client_id=${serviceName}&redirect_uri=${TestData.SERVICE_REDIRECT_URI}&jwt=${accessToken}`);
I.waitForText('Create an account or sign in', 30, 'h1');
I.click("Continue");
I.wait(2);
I.waitForText('Information is missing or invalid', 20, 'h2');
I.see('You have not entered your first name');
I.see('You have not entered your last name');
I.see('You have not entered your email address');
I.fillField('firstName', 'Lucy');
I.click('Continue');
I.wait(2);
I.dontSee('You have not entered your first name');
I.see('You have not entered your last name');
I.see('You have not entered your email address');
I.fillField('lastName', 'Lu');
I.click('Continue');
I.wait(2);
I.dontSee('You have not entered your first name');
I.dontSee('You have not entered your last name');
I.see('You have not entered your email address');
I.fillField('email', '111');
I.click('Continue');
I.wait(2);
I.see('Your email address is invalid');
I.fillField('firstName', 'L');
I.fillField('lastName', '@@');
I.click('Continue');
I.wait(2);
I.see('Your first name is invalid');
I.see('First name has to be longer than 1 character and should not include digits nor any of these characters:')
I.see('Your last name is invalid');
I.see('Last name has to be longer than 1 character and should not include digits nor any of these characters:')
I.click('Sign in to your account.');
I.wait(2);
I.seeInCurrentUrl(`redirect_uri=${encodeURIComponent(TestData.SERVICE_REDIRECT_URI).toLowerCase()}`);
I.seeInCurrentUrl('client_id=' + serviceName);
}).retry(TestData.SCENARIO_RETRY_LIMIT);
Expand All @@ -108,7 +102,6 @@ Scenario('@functional @uplift I am able to use a pin to create an account as an
I.fillField('#password2', TestData.PASSWORD);
I.click('Continue');
I.waitForText('Account created', 60, 'h1');
I.wait(2);
I.see('You can now sign in to your account.');
});

Expand All @@ -120,7 +113,6 @@ Scenario('@functional @upliftLogin uplift a user via login journey', async (I) =
I.amOnPage(`${TestData.WEB_PUBLIC_URL}/login/uplift?client_id=${serviceName}&redirect_uri=${TestData.SERVICE_REDIRECT_URI}&jwt=${accessToken}`);
I.waitForText('Sign in to your account.', 30);
I.click('Sign in to your account.');
I.wait(2);
I.seeInCurrentUrl(`register?redirect_uri=${encodeURIComponent(TestData.SERVICE_REDIRECT_URI).toLowerCase()}&client_id=${serviceName}`);
I.fillField('#username', existingCitizenEmail);
I.fillField('#password', TestData.PASSWORD);
Expand Down