-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip: fixes and new convenience options
- Loading branch information
Showing
20 changed files
with
466 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,32 @@ | ||
// eslint-disable-next-line node/no-extraneous-require,@typescript-eslint/no-var-requires,import/no-extraneous-dependencies | ||
const _ = require('lodash'); | ||
const PRESET = process.env.ALLURE_PRESET ?? 'default'; | ||
|
||
/** @type {import('jest-allure2-reporter').ReporterOptions} */ | ||
const jestAllure2ReporterOptions = { | ||
resultsDir: `allure-results/${PRESET}`, | ||
testCase: { | ||
name: ({ testCase }) => | ||
[...testCase.ancestorTitles, testCase.title].join(' » '), | ||
labels: { | ||
parentSuite: ({ filePath }) => filePath[0], | ||
suite: ({ filePath }) => filePath.slice(1, 2).join('/'), | ||
subSuite: ({ filePath }) => filePath.slice(2).join('/'), | ||
epic: ({ value }) => value ?? 'Uncategorized', | ||
story: ({ value }) => value ?? 'Untitled story', | ||
feature: ({ value }) => value ?? 'Untitled feature', | ||
package: ({ filePath }) => filePath.slice(0, -1).join('.'), | ||
testClass: ({ filePath }) => filePath.join('.').replace(/\.test\.[jt]s$/, ''), | ||
testMethod: ({ testCase }) => testCase.fullName, | ||
}, | ||
}, | ||
}; | ||
|
||
/** @type {import('@jest/types').Config.InitialOptions} */ | ||
module.exports = { | ||
// eslint-disable-next-line node/no-unpublished-require,import/no-extraneous-dependencies | ||
...require('@wix/jest-config-jest-allure2-reporter'), | ||
|
||
rootDir: './src/programmatic/grouping', | ||
testEnvironment: 'jest-allure2-reporter/dist/environment/node', | ||
reporters: [ | ||
'default', | ||
[ | ||
'jest-allure2-reporter', | ||
/** @type {Partial<import('jest-allure2-reporter').ReporterOptions>} */ { | ||
resultsDir: `allure-results/${PRESET}`, | ||
}, | ||
], | ||
], | ||
reporters: ['default', ['jest-allure2-reporter', jestAllure2ReporterOptions]], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
packages/e2e/src/programmatic/grouping/client/auth/ForgotPasswordScreen.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { $Epic, $Feature, $Story, $Tag } from 'jest-allure2-reporter'; | ||
|
||
$Tag('client'); | ||
$Epic('Authentication'); | ||
$Feature('Restore account'); | ||
describe('Forgot password screen', () => { | ||
$Story('Happy path'); | ||
describe('Rendering', () => { | ||
it('should render the forgot password form', () => { | ||
// ... | ||
}); | ||
}); | ||
|
||
describe('Form Submission', () => { | ||
$Story('Validation'); | ||
it('should show error on invalid e-mail format', () => { | ||
// ... | ||
}); | ||
|
||
$Story('Happy path'); | ||
it('should send forgot password request on valid e-mail', () => { | ||
// ... | ||
}); | ||
}); | ||
}); |
32 changes: 32 additions & 0 deletions
32
packages/e2e/src/programmatic/grouping/client/auth/LoginScreen.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { $Epic, $Feature, $Story, $Tag } from 'jest-allure2-reporter'; | ||
|
||
$Tag('client'); | ||
$Epic('Authentication'); | ||
$Feature('Login'); | ||
describe('Login screen', () => { | ||
$Story('Happy path'); | ||
describe('Rendering', () => { | ||
it('should render the login form by default', () => { | ||
// ... | ||
}); | ||
}); | ||
|
||
$Story('Validation'); | ||
describe('Form Submission', () => { | ||
it('should show error on invalid e-mail format', () => { | ||
// ... | ||
}); | ||
|
||
it('should show error on short or invalid password format', () => { | ||
// ... | ||
}); | ||
}); | ||
|
||
describe('Navigation', () => { | ||
$Feature('Restore account'); | ||
$Story('Happy path'); | ||
it('should navigate to forgot password screen on "forgot password" click', () => { | ||
// ... | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.