forked from ryparker/jest-circus-allure-environment
-
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.
Use describe names for the suite name
issue ryparker#179
- Loading branch information
1 parent
9e36a35
commit 2cb6e5f
Showing
9 changed files
with
142 additions
and
115 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,27 @@ | ||
const {ContentType} = require('../../dist'); | ||
|
||
test('allure.attachment()', () => { | ||
allure.attachment('TEXT-attachment', 'line1\nline2\nline3\n', ContentType.TEXT); | ||
allure.attachment('CSS-attachment', 'CSS content', ContentType.CSS); | ||
allure.attachment('CSV-attachment', 'a,b,c,d,e,f\n1,2,3,4,5,6', ContentType.CSV); | ||
allure.attachment('JSON-attachment', | ||
describe('Attachments', () => { | ||
test('allure.attachment()', () => { | ||
allure.attachment('TEXT-attachment', 'line1\nline2\nline3\n', ContentType.TEXT); | ||
allure.attachment('CSS-attachment', 'CSS content', ContentType.CSS); | ||
allure.attachment('CSV-attachment', 'a,b,c,d,e,f\n1,2,3,4,5,6', ContentType.CSV); | ||
allure.attachment('JSON-attachment', | ||
JSON.stringify({ | ||
string: 'foobar', | ||
number: 1, | ||
boolean: true, | ||
function: () => console.log('Ok it works.') | ||
}, null, 2), | ||
ContentType.JSON); | ||
allure.attachment('JPEG-attachment', '', ContentType.JPEG); | ||
allure.attachment('PNG-attachment', '', ContentType.PNG); | ||
allure.attachment('SVG attachment', '', ContentType.SVG); | ||
allure.attachment('HTML attachment', '<div><p>This is an HTML doc</p></div', ContentType.HTML); | ||
|
||
expect(1 + 2).toBe(3); | ||
}); | ||
|
||
test('HTML is available on ContentType enum', () => { | ||
expect(ContentType.HTML).toStrictEqual('text/html'); | ||
}); | ||
allure.attachment('JPEG-attachment', '', ContentType.JPEG); | ||
allure.attachment('PNG-attachment', '', ContentType.PNG); | ||
allure.attachment('SVG attachment', '', ContentType.SVG); | ||
allure.attachment('HTML attachment', '<div><p>This is an HTML doc</p></div', ContentType.HTML); | ||
|
||
expect(1 + 2).toBe(3); | ||
}); | ||
|
||
test('HTML is available on ContentType enum', () => { | ||
expect(ContentType.HTML).toStrictEqual('text/html'); | ||
}); | ||
}) |
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,5 +1,6 @@ | ||
|
||
test('allure.description()', () => { | ||
allure.description('This is an example description'); | ||
expect(5).toBe(5); | ||
}); | ||
describe('Description', () => { | ||
test('allure.description()', () => { | ||
allure.description('This is an example description'); | ||
expect(5).toBe(5); | ||
}); | ||
}) |
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,10 +1,11 @@ | ||
const {Status} = require('../../dist'); | ||
|
||
test('allure.logStep()', () => { | ||
allure.logStep('This is a PASSED logStep', Status.PASSED); | ||
allure.logStep('This is a FAILED logStep', Status.FAILED); | ||
allure.logStep('This is a BLOCKED logStep', Status.BROKEN); | ||
allure.logStep('This is a SKIPPED logStep', Status.SKIPPED); | ||
|
||
expect(5).toBe(5); | ||
}); | ||
describe('logStep', () => { | ||
test('allure.logStep()', () => { | ||
allure.logStep('This is a PASSED logStep', Status.PASSED); | ||
allure.logStep('This is a FAILED logStep', Status.FAILED); | ||
allure.logStep('This is a BLOCKED logStep', Status.BROKEN); | ||
allure.logStep('This is a SKIPPED logStep', Status.SKIPPED); | ||
|
||
expect(5).toBe(5); | ||
}); | ||
}) |
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,6 +1,7 @@ | ||
|
||
test('allure.parameter()', () => { | ||
allure.parameter('Argument 1', 'exampleValue'); | ||
|
||
expect(5).toBe(5); | ||
}); | ||
describe('Parameter', () => { | ||
test('allure.parameter()', () => { | ||
allure.parameter('Argument 1', 'exampleValue'); | ||
|
||
expect(5).toBe(5); | ||
}); | ||
}) |
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,32 +1,32 @@ | ||
const {Severity} = require('../../dist'); | ||
|
||
test('.severity = BLOCKER', () => { | ||
allure.severity(Severity.BLOCKER); | ||
|
||
expect(1 + 1).toBe(2); | ||
}); | ||
|
||
test('.severity = CRITICAL', () => { | ||
allure.severity(Severity.CRITICAL); | ||
|
||
expect(1 + 1).toBe(2); | ||
}); | ||
|
||
test('.severity = MINOR', () => { | ||
allure.severity(Severity.MINOR); | ||
|
||
expect(1 + 1).toBe(2); | ||
}); | ||
|
||
test('.severity = NORMAL', () => { | ||
allure.severity(Severity.NORMAL); | ||
|
||
expect(1 + 1).toBe(2); | ||
}); | ||
|
||
test('.severity = TRIVIAL', () => { | ||
allure.severity(Severity.TRIVIAL); | ||
|
||
expect(1 + 1).toBe(2); | ||
}); | ||
|
||
describe('severity', () => { | ||
test('.severity = BLOCKER', () => { | ||
allure.severity(Severity.BLOCKER); | ||
expect(1 + 1).toBe(2); | ||
}); | ||
test('.severity = CRITICAL', () => { | ||
allure.severity(Severity.CRITICAL); | ||
expect(1 + 1).toBe(2); | ||
}); | ||
test('.severity = MINOR', () => { | ||
allure.severity(Severity.MINOR); | ||
expect(1 + 1).toBe(2); | ||
}); | ||
test('.severity = NORMAL', () => { | ||
allure.severity(Severity.NORMAL); | ||
expect(1 + 1).toBe(2); | ||
}); | ||
test('.severity = TRIVIAL', () => { | ||
allure.severity(Severity.TRIVIAL); | ||
expect(1 + 1).toBe(2); | ||
}); | ||
}) |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
describe('Root suite', () => { | ||
describe('Nested root suite 1', () => { | ||
it('first assert', async () => { | ||
expect(true).toEqual(true); | ||
}); | ||
describe('Nested Nested root suite 1', () => { | ||
it('Nested Nested first assert', async () => { | ||
expect(true).toEqual(true); | ||
}); | ||
}); | ||
}); | ||
|
||
it('second assert', async () => { | ||
expect(true).toEqual(true); | ||
}); | ||
|
||
describe('Nested suite 2', () => { | ||
it('suite 2 first assert', async () => { | ||
expect(true).toEqual(true); | ||
}); | ||
|
||
it('suite 2 second assert', async () => { | ||
expect(true).toEqual(true); | ||
}); | ||
}); | ||
}); | ||
|
||
it('ROOT assert', async () => { | ||
expect(true).toEqual(true); | ||
}); |
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,16 +1,18 @@ | ||
test('Expect to pass', () => { | ||
expect(1 + 2).toBe(3); | ||
}); | ||
|
||
test.skip('Expect to skip', () => { | ||
expect(1 + 2).toBe(3); | ||
}); | ||
|
||
test('Expect to fail', () => { | ||
expect(2 + 2).toBe(6); | ||
}); | ||
|
||
test('Expect to break', () => { | ||
expect(3 + 2).toBe(5); | ||
foo.bar; | ||
}); | ||
describe('Status', () => { | ||
test('Expect to pass', () => { | ||
expect(1 + 2).toBe(3); | ||
}); | ||
|
||
test.skip('Expect to skip', () => { | ||
expect(1 + 2).toBe(3); | ||
}); | ||
|
||
test('Expect to fail', () => { | ||
expect(2 + 2).toBe(6); | ||
}); | ||
|
||
test('Expect to break', () => { | ||
expect(3 + 2).toBe(5); | ||
foo.bar; | ||
}); | ||
}) |
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