Skip to content

Commit 6a524f7

Browse files
committed
test: write first test in cucumber
1 parent e9062b1 commit 6a524f7

23 files changed

Lines changed: 927 additions & 72 deletions

playwright-staging/browserstack.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require('dotenv').config();
22

33
const base = require('@playwright/test');
4-
const clientPlaywrightVersion = require('@playwright/test/package.json').version; // "1.50.0"
4+
const clientPlaywrightVersion = require('@playwright/test/package.json').version; // "1.56.1"
55

66
// BrowserStack Specific Capabilities.
77
const caps = {
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = {
2+
default: {
3+
paths: ['tests/features/**/*.feature'],
4+
require: [
5+
'tests/support/**/*.js',
6+
'tests/step-definitions/**/*.js',
7+
],
8+
format: ['progress', 'summary'],
9+
// Use 'pretty' locally for readable step-by-step output.
10+
// On CI keep the output minimal to avoid noisy logs.
11+
publishQuiet: true,
12+
},
13+
};

playwright-staging/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"devDependencies": {
99
"@comicrelief/data-models": "^1.29.6",
1010
"@comicrelief/test-utils": "^1.5.15",
11+
"@cucumber/cucumber": "^12.8.2",
1112
"@playwright/test": "1.56.1",
1213
"axios": "^0.21.1",
1314
"chance": "^1.1.7",
@@ -16,6 +17,8 @@
1617
"uuid": "8.3.2"
1718
},
1819
"scripts": {
19-
"test:sanity": "FORCE_COLOR=1 playwright test --grep '@sanity'"
20+
"test:sanity": "FORCE_COLOR=1 playwright test --grep '@sanity'",
21+
"test:cucumber": "FORCE_COLOR=1 cucumber-js --config config/cucumber.js",
22+
"test:cucumber:sanity": "FORCE_COLOR=1 cucumber-js --config config/cucumber.js --tags '@sanity'"
2023
}
2124
}

playwright-staging/tests/submit/addressValidation.spec.js renamed to playwright-staging/tests/features/submit/addressValidation.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// @ts-check
22
const { expect } = require('@playwright/test');
3-
const { test } = require('../../browserstack');
4-
const { selectors } = require('../utils/locators');
3+
const { test } = require('../../../browserstack');
4+
const { selectors } = require('../../utils/locators');
55

66
test.describe('Address validation @sanity @nightly-sanity', () => {
77

playwright-staging/tests/submit/formValidation.spec.js renamed to playwright-staging/tests/features/submit/formValidation.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// @ts-check
22
const { expect } = require('@playwright/test');
3-
const { test } = require('../../browserstack');
4-
const { Commands } = require('../utils/commands');
5-
const { selectors } = require('../utils/locators');
3+
const { test } = require('../../../browserstack');
4+
const { Commands } = require('../../utils/commands');
5+
const { selectors } = require('../../utils/locators');
66

77
test.describe('Form validation @sanity @nightly-sanity', () => {
88

playwright-staging/tests/submit/internationalAddressesValidation.spec.js renamed to playwright-staging/tests/features/submit/internationalAddressesValidation.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// @ts-check
22
const { expect } = require('@playwright/test');
3-
const { test } = require('../../browserstack');
4-
const { Commands } = require('../utils/commands');
5-
const { selectors } = require('../utils/locators');
3+
const { test } = require('../../../browserstack');
4+
const { Commands } = require('../../utils/commands');
5+
const { selectors } = require('../../utils/locators');
66

77
test.describe('International addresses validation @sanity @nightly-sanity', () => {
88
test('selecting a non-UK country and entering a non-UK postcode should submit the form', async ({ page }) => {

playwright-staging/tests/submit/marketingPreferencesData.spec.js renamed to playwright-staging/tests/features/submit/marketingPreferencesData.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// @ts-check
22
const { expect } = require('@playwright/test');
3-
const { test } = require('../../browserstack');
4-
const { Commands } = require('../utils/commands');
5-
const { MarketingPrefsVerify } = require('../utils/marketingPrefsVerify');
6-
const { selectors } = require('../utils/locators');
3+
const { test } = require('../../../browserstack');
4+
const { Commands } = require('../../utils/commands');
5+
const { MarketingPrefsVerify } = require('../../utils/marketingPrefsVerify');
6+
const { selectors } = require('../../utils/locators');
77

88
const Chance = require('chance');
99
const chance = new Chance();

playwright-staging/tests/submit/marketingPreferencesValidation.spec.js renamed to playwright-staging/tests/features/submit/marketingPreferencesValidation.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// @ts-check
22
const { expect } = require('@playwright/test');
3-
const { test } = require('../../browserstack');
4-
const { Commands } = require('../utils/commands');
5-
const { selectors } = require('../utils/locators');
3+
const { test } = require('../../../browserstack');
4+
const { Commands } = require('../../utils/commands');
5+
const { selectors } = require('../../utils/locators');
66

77
const Chance = require('chance');
88
const chance = new Chance();

playwright-staging/tests/submit/postcodeLookup.spec.js renamed to playwright-staging/tests/features/submit/postcodeLookup.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// @ts-check
22
const { expect } = require('@playwright/test');
3-
const { test } = require('../../browserstack');
4-
const { selectors } = require('../utils/locators');
3+
const { test } = require('../../../browserstack');
4+
const { selectors } = require('../../utils/locators');
55

66
test.describe('Postcode validation @sanity @nightly-sanity', () => {
77

playwright-staging/tests/submit/sorry.spec.js renamed to playwright-staging/tests/features/submit/sorry.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// @ts-check
22
const { expect } = require('@playwright/test');
3-
const { test } = require('../../browserstack');
4-
const { selectors } = require('../utils/locators');
3+
const { test } = require('../../../browserstack');
4+
const { selectors } = require('../../utils/locators');
55

66
test('Accessing giftaid sorry page should show the sorry message @sanity @nightly-sanity', async ({ page }) => {
77
// Go directly to the "sorry" page appended to the base URL

0 commit comments

Comments
 (0)