From 274602e629f979b6c69e9c975d9925317c55e3ba Mon Sep 17 00:00:00 2001 From: Shravan Mechineni Date: Thu, 16 Jan 2020 15:45:56 +0000 Subject: [PATCH 1/4] fix flapping tests --- codecept.conf.js | 7 ++++--- .../js/account_lockout_reset_password_test.js | 2 +- src/test/js/dynamic_user_registration_test.js | 3 +-- src/test/js/mfa_e2e_test.js | 16 +++------------- src/test/js/policy_check_functional_test.js | 1 - src/test/js/reset_password_test.js | 17 +++-------------- src/test/js/self_registration_test.js | 17 ----------------- src/test/js/uplift_user_test.js | 8 -------- 8 files changed, 12 insertions(+), 59 deletions(-) diff --git a/codecept.conf.js b/codecept.conf.js index 9826c25ba..682e44010 100644 --- a/codecept.conf.js +++ b/codecept.conf.js @@ -8,11 +8,12 @@ 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, + waitForNavigation: ['load', 'domcontentloaded', 'networkidle0', 'networkidle2'], chrome: { //args: ["--proxy-server=" + process.env.PROXY_SERVER], ignoreHTTPSErrors: true diff --git a/src/test/js/account_lockout_reset_password_test.js b/src/test/js/account_lockout_reset_password_test.js index 0f70c9106..9b140bdba 100644 --- a/src/test/js/account_lockout_reset_password_test.js +++ b/src/test/js/account_lockout_reset_password_test.js @@ -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); diff --git a/src/test/js/dynamic_user_registration_test.js b/src/test/js/dynamic_user_registration_test.js index d79fd37ee..83750ec72 100644 --- a/src/test/js/dynamic_user_registration_test.js +++ b/src/test/js/dynamic_user_registration_test.js @@ -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.'); }); \ No newline at end of file diff --git a/src/test/js/mfa_e2e_test.js b/src/test/js/mfa_e2e_test.js index 4d9176ba4..a7bc23147 100644 --- a/src/test/js/mfa_e2e_test.js +++ b/src/test/js/mfa_e2e_test.js @@ -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); @@ -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'); @@ -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(); diff --git a/src/test/js/policy_check_functional_test.js b/src/test/js/policy_check_functional_test.js index 5e7a10cb7..71f90be56 100644 --- a/src/test/js/policy_check_functional_test.js +++ b/src/test/js/policy_check_functional_test.js @@ -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); \ No newline at end of file diff --git a/src/test/js/reset_password_test.js b/src/test/js/reset_password_test.js index ffa2474db..00d177ec4 100644 --- a/src/test/js/reset_password_test.js +++ b/src/test/js/reset_password_test.js @@ -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(); specialCharacterPassword = 'New&&&$$$%%%<>234'; const token = await I.getAuthToken(); @@ -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'); @@ -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'); @@ -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'); @@ -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); @@ -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"); @@ -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'); @@ -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); diff --git a/src/test/js/self_registration_test.js b/src/test/js/self_registration_test.js index f19437ac5..e74f3b7a0 100644 --- a/src/test/js/self_registration_test.js +++ b/src/test/js/self_registration_test.js @@ -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'); @@ -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"); @@ -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='); @@ -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"); @@ -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"); @@ -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='); @@ -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); \ No newline at end of file diff --git a/src/test/js/uplift_user_test.js b/src/test/js/uplift_user_test.js index 0f47029f2..6904c1d34 100644 --- a/src/test/js/uplift_user_test.js +++ b/src/test/js/uplift_user_test.js @@ -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); @@ -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.'); }); @@ -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); From afd8b637b214f3163fd4e18aefbf832fa9420540 Mon Sep 17 00:00:00 2001 From: Shravan Mechineni Date: Thu, 16 Jan 2020 17:41:04 +0000 Subject: [PATCH 2/4] fix flapping tests --- codecept.conf.js | 1 - 1 file changed, 1 deletion(-) diff --git a/codecept.conf.js b/codecept.conf.js index 682e44010..2c313a071 100644 --- a/codecept.conf.js +++ b/codecept.conf.js @@ -13,7 +13,6 @@ exports.config = { waitForTimeout: 60000, waitForAction: 2000, getPageTimeout: 20000, - waitForNavigation: ['load', 'domcontentloaded', 'networkidle0', 'networkidle2'], chrome: { //args: ["--proxy-server=" + process.env.PROXY_SERVER], ignoreHTTPSErrors: true From 2c9b88d1b837ec60977c6dd5b742c0475cf6c18d Mon Sep 17 00:00:00 2001 From: Shravan Mechineni Date: Fri, 17 Jan 2020 11:47:12 +0000 Subject: [PATCH 3/4] update wait time in the tests --- package-lock.json | 143 +++++++++++------- package.json | 4 +- .../js/account_lockout_reset_password_test.js | 2 +- src/test/js/dynamic_user_registration_test.js | 2 +- src/test/js/mfa_e2e_test.js | 7 +- src/test/js/reset_password_test.js | 10 +- src/test/js/self_registration_test.js | 6 +- src/test/js/shared/custom_steps.js | 2 +- src/test/js/uplift_user_test.js | 2 +- ...s_and_post_activation_redirect_url_test.js | 3 +- ...th_the_same_uuid_in_pending_status_test.js | 2 +- yarn.lock | 33 ++-- 12 files changed, 129 insertions(+), 87 deletions(-) diff --git a/package-lock.json b/package-lock.json index 90e80004d..60a4b0ce2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -92,26 +92,18 @@ "dev": true }, "async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz", - "integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==", + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", + "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", "dev": true, "requires": { - "lodash": "^4.17.11" - }, - "dependencies": { - "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", - "dev": true - } + "lodash": "^4.17.14" } }, "async-limiter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", - "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", + "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==", "dev": true }, "asynckit": { @@ -174,9 +166,9 @@ } }, "bluebird": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.1.tgz", - "integrity": "sha512-DdmyoGCleJnkbp3nkbxTLJ18rjDsE4yCggEwKNXkeV123sPNfOCYeDoeuOY+F2FrSjO1YXcTU+dsy96KMy+gcg==", + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", "dev": true }, "bo-selector": { @@ -546,20 +538,12 @@ "dev": true }, "deep-defaults": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/deep-defaults/-/deep-defaults-1.0.4.tgz", - "integrity": "sha1-Gpdi4rbI1qTpkxuO5/+M3O4dF1A=", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/deep-defaults/-/deep-defaults-1.0.5.tgz", + "integrity": "sha512-5ev/sNkiHTmeTqbDJEDgdQa/Ub0eOMQNix9l+dLLGbwOos7/in5HdvHXI014wqxsET4YeJG9Eq4qj0PJRL8rSw==", "dev": true, "requires": { - "lodash": "3.0.x" - }, - "dependencies": { - "lodash": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.0.1.tgz", - "integrity": "sha1-FNSQKKOLx0AkHRHi7NV+wG1zwZo=", - "dev": true - } + "lodash": "^4.17.5" } }, "deep-eql": { @@ -582,9 +566,9 @@ }, "dependencies": { "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true } } @@ -1237,23 +1221,38 @@ } }, "https-proxy-agent": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz", - "integrity": "sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==", + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz", + "integrity": "sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==", "dev": true, "requires": { - "agent-base": "^4.1.0", + "agent-base": "^4.3.0", "debug": "^3.1.0" }, "dependencies": { + "agent-base": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", + "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", + "dev": true, + "requires": { + "es6-promisify": "^5.0.0" + } + }, "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", "dev": true, "requires": { - "ms": "2.0.0" + "ms": "^2.1.1" } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true } } }, @@ -1659,9 +1658,9 @@ } }, "lodash": { - "version": "4.17.10", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", - "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true }, "lodash.includes": { @@ -2210,9 +2209,9 @@ } }, "notifications-node-client": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/notifications-node-client/-/notifications-node-client-4.6.0.tgz", - "integrity": "sha512-O5aRzQc7rJxyrmlBHXbXsGJu3/mmTtoEYzuWawNA+gVx894dFoflGDN+QBiMuB9t0aDPdjpgCB081zIbDKc/Jw==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/notifications-node-client/-/notifications-node-client-4.7.0.tgz", + "integrity": "sha512-u3xjddyiSmlxFummgiWgG5uBbZk29D7xnT8hIfIRiFFoFlpq3rzN/yGBJRwedCb79t38SAenmH/fPSQbpkC1/A==", "dev": true, "requires": { "jsonwebtoken": "8.2.1", @@ -2668,14 +2667,14 @@ "dev": true }, "puppeteer": { - "version": "1.18.1", - "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-1.18.1.tgz", - "integrity": "sha512-luUy0HPSuWPsPZ1wAp6NinE0zgetWtudf5zwZ6dHjMWfYpTQcmKveFRox7VBNhQ98OjNA9PQ9PzQyX8k/KrxTg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-2.0.0.tgz", + "integrity": "sha512-t3MmTWzQxPRP71teU6l0jX47PHXlc4Z52sQv4LJQSZLq1ttkKS2yGM3gaI57uQwZkNaoGd0+HPPMELZkcyhlqA==", "dev": true, "requires": { "debug": "^4.1.0", "extract-zip": "^1.6.6", - "https-proxy-agent": "^2.2.1", + "https-proxy-agent": "^3.0.0", "mime": "^2.0.3", "progress": "^2.0.1", "proxy-from-env": "^1.0.0", @@ -2683,6 +2682,15 @@ "ws": "^6.1.0" }, "dependencies": { + "agent-base": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", + "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", + "dev": true, + "requires": { + "es6-promisify": "^5.0.0" + } + }, "debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", @@ -2692,6 +2700,27 @@ "ms": "^2.1.1" } }, + "https-proxy-agent": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-3.0.1.tgz", + "integrity": "sha512-+ML2Rbh6DAuee7d07tYGEKOEi2voWPUGan+ExdPbPW6Z3svq+JCqr0v8WmKPOkz1vOVykPCBSuobe7G8GJUtVg==", + "dev": true, + "requires": { + "agent-base": "^4.3.0", + "debug": "^3.1.0" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + } + } + }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -3102,9 +3131,9 @@ }, "dependencies": { "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true } } @@ -3443,9 +3472,9 @@ "dev": true }, "underscore": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz", - "integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg==", + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.2.tgz", + "integrity": "sha512-D39qtimx0c1fI3ya1Lnhk3E9nONswSKhnffBI0gME9C99fYOkNi04xs8K6pePLhvl1frbDemkaBQ5ikWllR2HQ==", "dev": true }, "universalify": { diff --git a/package.json b/package.json index b108cbb12..911659363 100644 --- a/package.json +++ b/package.json @@ -15,9 +15,9 @@ "mocha-multi": "^1.0.1", "mochawesome": "^3.0.2", "nightmare": "^3.0.1", - "notifications-node-client": "^4.6.0", + "notifications-node-client": "^4.7.0", "pa11y": "^4.13.2", "proxy-agent": "^3.0.1", - "puppeteer": "^1.4.0" + "puppeteer": "^2.0.0" } } diff --git a/src/test/js/account_lockout_reset_password_test.js b/src/test/js/account_lockout_reset_password_test.js index 9b140bdba..36f277725 100644 --- a/src/test/js/account_lockout_reset_password_test.js +++ b/src/test/js/account_lockout_reset_password_test.js @@ -44,7 +44,7 @@ Scenario('@functional @unlock My user account is unlocked when I reset my passwo I.fillField('#email', citizenEmail); I.click('Submit'); I.waitForText('Check your email', 20, 'h1'); - I.wait(10); + I.wait(5); const resetPasswordUrl = await I.extractUrl(citizenEmail); I.amOnPage(resetPasswordUrl); I.waitForText('Create a new password', 20, 'h1'); diff --git a/src/test/js/dynamic_user_registration_test.js b/src/test/js/dynamic_user_registration_test.js index 83750ec72..e4c9df95f 100644 --- a/src/test/js/dynamic_user_registration_test.js +++ b/src/test/js/dynamic_user_registration_test.js @@ -42,7 +42,7 @@ AfterSuite(async (I) => { }); Scenario('@functional Register User Dynamically', async (I) => { - I.wait(10); + I.wait(5); let url = await I.extractUrl(userEmail); if (url) { diff --git a/src/test/js/mfa_e2e_test.js b/src/test/js/mfa_e2e_test.js index a7bc23147..95452661f 100644 --- a/src/test/js/mfa_e2e_test.js +++ b/src/test/js/mfa_e2e_test.js @@ -68,10 +68,9 @@ Scenario('@functional @mfaLogin I am able to login with MFA', async (I) => { I.fillField('#username', mfaUserEmail); I.fillField('#password', TestData.PASSWORD); I.click('Sign in'); - I.wait(10); I.seeInCurrentUrl("/verification"); I.waitForText('Verification required', 10, 'h1'); - + I.wait(5); const otpCode = await I.extractOtpFromEmail(mfaUserEmail); I.fillField('code', otpCode); @@ -105,7 +104,7 @@ Scenario('@functional @mfaLogin Validate verification code and 3 incorrect otp a I.click('Sign in'); I.waitInUrl("/verification", 20); I.waitForText('Verification required', 2, 'h1'); - I.wait(10); + I.wait(5); const otpCode = await I.extractOtpFromEmail(mfaUserEmail); // empty field @@ -139,7 +138,7 @@ 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.seeInCurrentUrl('verification'); + I.waitInUrl('/verification', 20); I.waitForText('Verification required', 2, 'h1'); const otpCodeLatest = await I.extractOtpFromEmail(mfaUserEmail); diff --git a/src/test/js/reset_password_test.js b/src/test/js/reset_password_test.js index 00d177ec4..ca14f217f 100644 --- a/src/test/js/reset_password_test.js +++ b/src/test/js/reset_password_test.js @@ -59,7 +59,7 @@ Scenario('@functional @resetpass As a citizen user I can reset my password', asy I.fillField('#email', citizenEmail); I.click('Submit'); I.waitForText('Check your email', 20, 'h1'); - I.wait(10); + I.wait(5); const resetPasswordUrl = await I.extractUrl(citizenEmail); I.amOnPage(resetPasswordUrl); I.waitForText('Create a new password', 20, 'h1'); @@ -90,7 +90,7 @@ Scenario('@functional @resetpasswithdiffcaseemail As a citizen user I can reset I.fillField('#email', citizenEmail.toUpperCase()); I.click('Submit'); I.waitForText('Check your email', 20, 'h1'); - I.wait(10); + I.wait(5); const resetPasswordUrl = await I.extractUrl(citizenEmail); I.amOnPage(resetPasswordUrl); I.waitForText('Create a new password', 20, 'h1'); @@ -120,7 +120,7 @@ Scenario('@functional @resetpass As a citizen user with a plus email I can reset I.fillField('#email', plusCitizenEmail); I.click('Submit'); I.waitForText('Check your email', 20, 'h1'); - I.wait(10); + I.wait(5); const resetPasswordUrl = await I.extractUrl(plusCitizenEmail); I.amOnPage(resetPasswordUrl); I.waitForText('Create a new password', 20, 'h1'); @@ -150,7 +150,7 @@ Scenario('@functional @resetpass @passwordvalidation Validation displayed when I I.fillField('#email', otherCitizenEmail); I.click('Submit'); I.waitForText('Check your email', 20, 'h1'); - I.wait(10); + I.wait(5); const resetPasswordUrl = await I.extractUrl(otherCitizenEmail); I.amOnPage(resetPasswordUrl); I.waitForText('Create a new password', 20, 'h1'); @@ -191,7 +191,7 @@ Scenario('@functional @resetpass As a citizen user I can reset my password with I.fillField('#email', citizenEmail); I.click('Submit'); I.waitForText('Check your email', 20, 'h1'); - I.wait(10); + I.wait(5); const resetPasswordUrl = await I.extractUrl(citizenEmail); I.amOnPage(resetPasswordUrl); I.waitForText('Create a new password', 20, 'h1'); diff --git a/src/test/js/self_registration_test.js b/src/test/js/self_registration_test.js index e74f3b7a0..c97b48fdb 100644 --- a/src/test/js/self_registration_test.js +++ b/src/test/js/self_registration_test.js @@ -79,7 +79,7 @@ Scenario('@functional @selfregister Account already created', async (I) => { I.waitForText('Check your email', 20, 'h1'); - I.wait(10); + I.wait(5); const emailResponse = await I.getEmail(citizenEmail); assert.equal('You already have an account', emailResponse.subject); @@ -100,7 +100,7 @@ Scenario('@functional @selfregister I can self register', async (I) => { I.fillField('email', email); I.click("Continue"); I.waitForText('Check your email', 20, 'h1'); - I.wait(10); + I.wait(5); const userActivationUrl = await I.extractUrl(email); I.amOnPage(userActivationUrl); I.waitForText('Create a password', 20, 'h1'); @@ -146,7 +146,7 @@ Scenario('@functional @selfregister @prePopulatedScreen I can self register with I.click("Continue"); I.waitForText('Check your email', 20, 'h1'); - I.wait(10); + I.wait(5); const userActivationUrl = await I.extractUrl(randomUserEmailAddress); I.amOnPage(userActivationUrl); I.waitForText('Create a password', 20, 'h1'); diff --git a/src/test/js/shared/custom_steps.js b/src/test/js/shared/custom_steps.js index 52f34b820..af0b3759d 100644 --- a/src/test/js/shared/custom_steps.js +++ b/src/test/js/shared/custom_steps.js @@ -70,7 +70,7 @@ module.exports = function() { this.fillField('password', '111111111111111111'); this.scrollPageToBottom(); this.click('Sign in'); - this.wait(10); + this.wait(5); // Final this.amOnPage(loginPage + 'attemptfinal'); this.waitForText('Sign in', 180, 'h1'); diff --git a/src/test/js/uplift_user_test.js b/src/test/js/uplift_user_test.js index 6904c1d34..b1a6e3cce 100644 --- a/src/test/js/uplift_user_test.js +++ b/src/test/js/uplift_user_test.js @@ -91,7 +91,7 @@ Scenario('@functional @uplift I am able to use a pin to create an account as an I.scrollPageToBottom(); I.click('Continue'); I.waitForText('Check your email', 20, 'h1'); - I.wait(10); + I.wait(5); let url = await I.extractUrl(citizenEmail); if (url) { url = url.replace('https://idam-web-public.aat.platform.hmcts.net', TestData.WEB_PUBLIC_URL); diff --git a/src/test/js/user_registration_pending_status_and_post_activation_redirect_url_test.js b/src/test/js/user_registration_pending_status_and_post_activation_redirect_url_test.js index 9784bfc9a..ef897a764 100644 --- a/src/test/js/user_registration_pending_status_and_post_activation_redirect_url_test.js +++ b/src/test/js/user_registration_pending_status_and_post_activation_redirect_url_test.js @@ -52,13 +52,12 @@ AfterSuite(async (I) => { }); Scenario('@functional user registration pending status and post activation redirect url test', async (I) => { - I.wait(10); + I.wait(5); const responseBeforeActivation = await I.getUserById(userId, accessToken); expect(responseBeforeActivation.id).to.equal(userId); expect(responseBeforeActivation.pending).to.equal(true); - I.wait(10); const url = await I.extractUrl(userEmail); I.amOnPage(url); diff --git a/src/test/js/user_registration_with_the_same_uuid_in_pending_status_test.js b/src/test/js/user_registration_with_the_same_uuid_in_pending_status_test.js index a2540cf95..a218db796 100644 --- a/src/test/js/user_registration_with_the_same_uuid_in_pending_status_test.js +++ b/src/test/js/user_registration_with_the_same_uuid_in_pending_status_test.js @@ -59,7 +59,7 @@ AfterSuite(async (I) => { }); Scenario('@functional multiple users can be registered with same uuid but the previous user will be assigned with auto generated uuid upon activation', async (I) => { - I.wait(10); + I.wait(5); const responseBeforeActivation = await I.getUserById(userId, accessToken); expect(responseBeforeActivation.id).to.equal(userId); diff --git a/yarn.lock b/yarn.lock index 07debc195..b6d9314b7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18,6 +18,13 @@ agent-base@^4.1.0: dependencies: es6-promisify "^5.0.0" +agent-base@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.3.0.tgz#8165f01c436009bccad0b1d122f05ed770efc6ee" + integrity sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg== + dependencies: + es6-promisify "^5.0.0" + ajv@^5.1.0, ajv@^5.3.0: version "5.5.2" resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" @@ -885,6 +892,14 @@ https-proxy-agent@^2.2.1: agent-base "^4.1.0" debug "^3.1.0" +https-proxy-agent@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-3.0.1.tgz#b8c286433e87602311b01c8ea34413d856a4af81" + integrity sha512-+ML2Rbh6DAuee7d07tYGEKOEi2voWPUGan+ExdPbPW6Z3svq+JCqr0v8WmKPOkz1vOVykPCBSuobe7G8GJUtVg== + dependencies: + agent-base "^4.3.0" + debug "^3.1.0" + iconv-lite@0.4.23, iconv-lite@~0.4.13: version "0.4.23" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" @@ -1457,10 +1472,10 @@ normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: semver "2 || 3 || 4 || 5" validate-npm-package-license "^3.0.1" -notifications-node-client@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/notifications-node-client/-/notifications-node-client-4.6.0.tgz#9dad18d25bdcd5aa2fd329ba84f44262ee8fc411" - integrity sha512-O5aRzQc7rJxyrmlBHXbXsGJu3/mmTtoEYzuWawNA+gVx894dFoflGDN+QBiMuB9t0aDPdjpgCB081zIbDKc/Jw== +notifications-node-client@^4.7.0: + version "4.7.0" + resolved "https://registry.yarnpkg.com/notifications-node-client/-/notifications-node-client-4.7.0.tgz#127ecaa71b8bc27fec2f7e7a19b3c163af08c183" + integrity sha512-u3xjddyiSmlxFummgiWgG5uBbZk29D7xnT8hIfIRiFFoFlpq3rzN/yGBJRwedCb79t38SAenmH/fPSQbpkC1/A== dependencies: jsonwebtoken "8.2.1" request "2.87.0" @@ -1761,14 +1776,14 @@ punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" -puppeteer@^1.4.0: - version "1.18.1" - resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-1.18.1.tgz#4a66f3bdab01115ededf70443ec904c99917a815" - integrity sha512-luUy0HPSuWPsPZ1wAp6NinE0zgetWtudf5zwZ6dHjMWfYpTQcmKveFRox7VBNhQ98OjNA9PQ9PzQyX8k/KrxTg== +puppeteer@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-2.0.0.tgz#0612992e29ec418e0a62c8bebe61af1a64d7ec01" + integrity sha512-t3MmTWzQxPRP71teU6l0jX47PHXlc4Z52sQv4LJQSZLq1ttkKS2yGM3gaI57uQwZkNaoGd0+HPPMELZkcyhlqA== dependencies: debug "^4.1.0" extract-zip "^1.6.6" - https-proxy-agent "^2.2.1" + https-proxy-agent "^3.0.0" mime "^2.0.3" progress "^2.0.1" proxy-from-env "^1.0.0" From 4eee2de66eaa3e2876512d9edb52f3d847ea08de Mon Sep 17 00:00:00 2001 From: Shravan Mechineni Date: Fri, 17 Jan 2020 16:13:56 +0000 Subject: [PATCH 4/4] fix review comment --- src/test/js/reset_password_test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/js/reset_password_test.js b/src/test/js/reset_password_test.js index ca14f217f..5f26fa80d 100644 --- a/src/test/js/reset_password_test.js +++ b/src/test/js/reset_password_test.js @@ -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()}`; specialCharacterPassword = 'New&&&$$$%%%<>234'; const token = await I.getAuthToken();