Skip to content

Commit

Permalink
Merge pull request #17031 from mozilla/FXA-9388
Browse files Browse the repository at this point in the history
chore(functional-tests): define a test timeout at the config level
  • Loading branch information
Trinaa authored May 30, 2024
2 parents ee1bea8 + 23cea86 commit b0d5e0e
Show file tree
Hide file tree
Showing 59 changed files with 7 additions and 163 deletions.
3 changes: 3 additions & 0 deletions packages/functional-tests/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ export default defineConfig<PlaywrightTestConfig<TestOptions, WorkerOptions>>({
// Retry on CI only.
retries: CI ? 1 : 0,

// Total allowable time spent for the test function, fixtures, beforeEach and afterEach hooks. Defaults to 30 seconds.
timeout: 60000, // 1 minute

use: {
viewport: { width: 1280, height: 720 },
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ const HINT = 'secret key location';
* key stretched passwords. We need to ensure that operations are interchangeable!
*/
test.describe('severity-2 #smoke', () => {
test.slow();

// Helpers
async function _getKeys(
version: 1 | 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ const AGE_21 = '21';
* key stretched passwords. We need to ensure that operations are interchangeable!
*/
test.describe('severity-2 #smoke', () => {
test.slow();

// Helpers
async function _getKeys(
version: 1 | 2,
Expand Down
1 change: 0 additions & 1 deletion packages/functional-tests/tests/misc.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ test.describe('severity-1', () => {
// runs all mocha tests - see output here: http://127.0.0.1:3030/tests/index.html
test('content-server mocha tests', async ({ target, page }, { project }) => {
test.skip(project.name !== 'local', 'mocha tests are local only');
test.slow();
await page.goto(`${target.contentServerUrl}/tests/index.html`, {
waitUntil: 'load',
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { test, expect } from '../../lib/fixtures/standard';
//Add `disable_local_storage` to the URL to synthesize cookies being disabled.
test.describe('cookies disabled', () => {
test.beforeEach(async ({ pages: { login } }) => {
test.slow();
await login.clearCache();
});

Expand Down
6 changes: 2 additions & 4 deletions packages/functional-tests/tests/oauth/forceAuth.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,12 @@ test.describe('severity-1 #smoke', () => {
test('with a unregistered email', async ({
pages: { configPage, login, relier },
testAccountTracker,
}, { project }) => {
}) => {
const config = await configPage.getConfig();
test.skip(
config.showReactApp.signUpRoutes === true,
'Scheduled for removal as part of React conversion (see FXA-9410).'
);
test.slow(project.name !== 'local', 'email delivery can be slow');
const credentials = await testAccountTracker.signUp();
const newEmail = testAccountTracker.generateEmail();

Expand All @@ -62,13 +61,12 @@ test.describe('severity-1 #smoke', () => {
page,
pages: { configPage, login, relier, settings, deleteAccount },
testAccountTracker,
}, { project }) => {
}) => {
const config = await configPage.getConfig();
test.skip(
config.showReactApp.signUpRoutes === true,
'Scheduled for removal as part of React conversion (see FXA-9410).'
);
test.slow(project.name !== 'local', 'email delivery can be slow');

const credentials = await testAccountTracker.signUp();
const blockedEmail = testAccountTracker.generateBlockedEmail();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { expect, test } from '../../lib/fixtures/standard';
test.describe('severity-1 #smoke', () => {
test.describe('oauth permissions for trusted reliers - sign in', () => {
test.beforeEach(async ({ pages: { login } }) => {
test.slow();
await login.clearCache();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ test.describe('severity-1 #smoke', () => {
config.showReactApp.signUpRoutes === true,
'these tests are specific to backbone, skip if seeing React version'
);
test.slow();
});

test('signup without `prompt=consent`', async ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ test.describe('severity-1 #smoke', () => {
project.name === 'production',
'test plan not yet available in prod'
);
test.slow();
});

test.describe('oauth prompt none', () => {
Expand Down
1 change: 0 additions & 1 deletion packages/functional-tests/tests/oauth/signUp.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ test.describe('severity-1 #smoke', () => {
config.showReactApp.signUpRoutes === true,
'this test is specific to backbone, skip if serving react'
);
test.slow();
});

test.describe('Oauth sign up', () => {
Expand Down
4 changes: 0 additions & 4 deletions packages/functional-tests/tests/oauth/signin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
import { expect, test } from '../../lib/fixtures/standard';

test.describe('severity-1 #smoke', () => {
test.beforeEach(({}, { project }) => {
test.slow(project.name !== 'local', 'email delivery can be slow');
});

test.describe('OAuth signin', () => {
test('verified', async ({
pages: { login, relier },
Expand Down
4 changes: 0 additions & 4 deletions packages/functional-tests/tests/oauth/signinBlocked.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ import { SettingsPage } from '../../pages/settings';
import { DeleteAccountPage } from '../../pages/settings/deleteAccount';

test.describe('severity-1 #smoke', () => {
test.beforeEach(({}, { project }) => {
test.slow(project.name !== 'local', 'email delivery can be slow');
});

test.describe('OAuth signin blocked', () => {
test('verified, blocked', async ({
page,
Expand Down
4 changes: 0 additions & 4 deletions packages/functional-tests/tests/oauth/syncSignIn.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ import { expect, test } from '../../lib/fixtures/standard';
const AGE_21 = '21';

test.describe('severity-1 #smoke', () => {
test.beforeEach(() => {
test.slow();
});

test.describe('signin with OAuth after Sync', () => {
test('signin to OAuth with Sync creds', async ({
target,
Expand Down
4 changes: 0 additions & 4 deletions packages/functional-tests/tests/oauth/totp.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ import { LoginPage } from '../../pages/login';

test.describe('severity-1 #smoke', () => {
test.describe('OAuth totp', () => {
test.beforeEach(async () => {
test.slow();
});

test('can add TOTP to account and confirm oauth signin', async ({
target,
pages: { page, login, relier, settings, totp },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ import { expect, test } from '../../lib/fixtures/standard';

test.describe('severity-2 #smoke', () => {
test.describe('post verify - force password change', () => {
test.beforeEach(async () => {
test.slow();
});

test('navigate to page directly and can change password', async ({
target,
pages: { page, login, postVerify },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { getReactFeatureFlagUrl } from '../../lib/react-flag';

test.describe('force auth react', () => {
test.beforeEach(async ({ pages: { configPage } }) => {
test.slow();
// Ensure that the feature flag is enabled
const config = await configPage.getConfig();
test.skip(config.showReactApp.signInRoutes !== true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ test.describe('severity-1 #smoke', () => {
config.featureFlags.resetPasswordWithCode === true,
'see FXA-9612'
);
test.slow();
});

test('reset password', async ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ test.describe('severity-1 #smoke', () => {
config.featureFlags.resetPasswordWithCode === true,
'see FXA-9612'
);
test.slow();
});

test('reset password with account recovery key', async ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ test.describe('severity-1 #smoke', () => {
config.featureFlags.resetPasswordWithCode === true,
'see FXA-9612'
);
test.slow();
});

test('reset password scoped keys', async ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ test.describe('severity-1 #smoke', () => {
config.featureFlags.resetPasswordWithCode === true,
'see FXA-9612'
);
test.slow();
});

test('reset password through Sync mobile', async ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ test.describe('severity-1 #smoke', () => {
config.showReactApp.signInRoutes !== true,
'React signInRoutes not enabled'
);
test.slow();
});

test('verified account, no email confirmation required', async ({
Expand All @@ -25,6 +24,7 @@ test.describe('severity-1 #smoke', () => {
project.name !== 'local',
'Fix required as of 2024/04/26 (see FXA-9518).'
);
test.setTimeout(120000); // 2 minutes

const credentials = await testAccountTracker.signUp();

Expand Down Expand Up @@ -218,8 +218,7 @@ test.describe('severity-1 #smoke', () => {
page,
pages: { configPage, relier, signinReact, signupReact },
testAccountTracker,
}, { project }) => {
test.slow(project.name !== 'local', 'email delivery can be slow');
}) => {
const config = await configPage.getConfig();
test.skip(
config.showReactApp.signUpRoutes !== true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ test.describe('severity-1 #smoke', () => {
config.showReactApp.signUpRoutes !== true,
'Skip tests if not on React signUpRoutes'
);
test.slow();
});

test('signup oauth', async ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ test.describe('severity-1 #smoke', () => {
config.featureFlags.resetPasswordWithCode === true,
'see FXA-9612'
);
test.slow();
});

test('can reset password with recovery key', async ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ test.describe('severity-1 #smoke', () => {
config.featureFlags.resetPasswordWithCode === true,
'see FXA-9612'
);
test.slow();
});

test('can reset password', async ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
import { test, expect } from '../../lib/fixtures/standard';

test.describe('severity-1 #smoke', () => {
// Slowing down test, was timing out on credentials teardown
test.slow();

test('react signin to sync and disconnect', async ({
syncBrowserPages: {
configPage,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ test.describe('severity-1 #smoke', () => {
config.showReactApp.signInRoutes !== true,
'React signInRoutes not enabled'
);
test.slow();
});

test('add totp', async ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ test.describe('severity-1 #smoke', () => {
config.showReactApp.signUpRoutes !== true,
'Skip tests if not on React signUpRoutes'
);
test.slow();
});

test('signup web', async ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ test.describe('severity-1 #smoke', () => {
config.featureFlags.resetPasswordWithCode === true,
'see FXA-9612'
);
test.slow();
});

test('reset pw for sync user', async ({
Expand Down
4 changes: 0 additions & 4 deletions packages/functional-tests/tests/settings/changeEmail.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ import { SecondaryEmailPage } from '../../pages/settings/secondaryEmail';

test.describe('severity-1 #smoke', () => {
test.describe('change primary email tests', () => {
test.beforeEach(async () => {
test.slow();
});

test('change primary email and login', async ({
target,
pages: { page, login, settings, secondaryEmail },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ import { SecondaryEmailPage } from '../../pages/settings/secondaryEmail';

test.describe('severity-1 #smoke', () => {
test.describe('change primary - unblock', () => {
test.beforeEach(async () => {
test.slow();
});

test('change primary email, get blocked with invalid password, redirect enter password page', async ({
target,
pages: { page, settings, login, secondaryEmail, deleteAccount },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ test.describe('severity-1 #smoke', () => {
pages: { page, login, settings, changePassword },
testAccountTracker,
}) => {
test.slow();

await signInAccount(target, page, login, testAccountTracker);
const newPassword = testAccountTracker.generatePassword();

Expand All @@ -36,8 +34,6 @@ test.describe('severity-1 #smoke', () => {
pages: { page, settings, changePassword, login },
testAccountTracker,
}) => {
test.slow();

const credentials = await signInAccount(
target,
page,
Expand Down Expand Up @@ -111,8 +107,6 @@ test.describe('severity-1 #smoke', () => {
config.featureFlags.resetPasswordWithCode === true,
'see FXA-9612'
);
test.slow();

await signInAccount(target, page, login, testAccountTracker);

await settings.goto();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ import { TestAccountTracker } from '../../lib/testAccountTracker';
import { LoginPage } from '../../pages/login';

test.describe('severity-1 #smoke', () => {
test.beforeEach(async () => {
test.slow();
});

test('cancel delete account step 1', async ({
target,
pages: { page, login, settings, deleteAccount },
Expand Down
1 change: 0 additions & 1 deletion packages/functional-tests/tests/settings/fxaStatus.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ test.describe('fxa_status web channel message in Settings', () => {
// Ensure that the feature flag is enabled
const config = await configPage.getConfig();
test.skip(config.featureFlags.sendFxAStatusOnSettings !== true);
test.slow();
});

test('message is sent when loading with context = oauth_webchannel_v1', async ({
Expand Down
7 changes: 0 additions & 7 deletions packages/functional-tests/tests/settings/recoveryKey.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import fs from 'fs';
import pdfParse from 'pdf-parse';
import { TestAccountTracker } from '../../lib/testAccountTracker';
import { EmailHeader, EmailType } from '../../lib/email';
import { Page, expect, test } from '../../lib/fixtures/standard';
import { BaseTarget, Credentials } from '../../lib/targets/base';
import { LoginPage } from '../../pages/login';
Expand All @@ -14,12 +13,6 @@ const HINT = 'secret key location';

test.describe('severity-1 #smoke', () => {
test.describe('recovery key test', () => {
test.beforeEach(async () => {
// Generating and consuming recovery keys is a slow process
// Mail delivery can also be slow
test.slow();
});

test('can copy recovery key', async ({
target,
pages: { page, login, recoveryKey, settings },
Expand Down
5 changes: 0 additions & 5 deletions packages/functional-tests/tests/settings/totp.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ import { TotpCredentials, TotpPage } from '../../pages/settings/totp';

test.describe('severity-1 #smoke', () => {
test.describe('two step auth', () => {
test.beforeEach(async () => {
// 2FA test can be slow because of time to generate recovery keys
test.slow();
});

test('add and remove totp', async ({
target,
pages: { page, settings, totp, login },
Expand Down
1 change: 0 additions & 1 deletion packages/functional-tests/tests/signUp/signUp.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ test.describe('severity-2 #smoke', () => {
config.showReactApp.signUpRoutes === true,
'these tests are specific to backbone, skip if serving React version'
);
test.slow();
});

test('with an invalid email, empty email query query param', async ({
Expand Down
Loading

0 comments on commit b0d5e0e

Please sign in to comment.