-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support
step
and attach
methods for test cases.
```javascript import { qase } from 'testcafe-qase-reporter/qase'; test('test', async (t) => { qase.attach({ name: 'attachment.txt', content: 'Hello, world!', contentType: 'text/plain' }); await qase.step('Step 1', async (s1) => { await s1.step('Step 1.1', async (s11) => { await s11.step('Step 1.1.1', async (s111) => { s11.attach({ name: 'attachment.txt', content: 'Hello, world!', contentType: 'text/plain' }); await s111.expect(true).ok(); }); }); await t.expect(true).ok(); }); await t.expect(true).ok(); }); ```
- Loading branch information
Showing
15 changed files
with
445 additions
and
101 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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { test } from 'testcafe'; | ||
import { qase } from 'testcafe-reporter-qase/qase'; | ||
|
||
fixture`Attachment tests` | ||
.page`http://devexpress.github.io/testcafe/example/`; | ||
|
||
test('Test with file attachment success', async (t) => { | ||
qase.attach({ paths: ['examples/testcafe/attachmentTests.js'] }); | ||
await t.expect(true).ok(); | ||
}); | ||
|
||
test('Test with file attachment failed', async (t) => { | ||
qase.attach({ paths: ['examples/testcafe/attachmentTests.js'] }); | ||
await t.expect(false).ok(); | ||
}); | ||
|
||
test('Test with content attachment success', async (t) => { | ||
qase.attach({ name: 'log.txt', content: 'Hello, World!', type: 'text/plain' }); | ||
await t.expect(true).ok(); | ||
}); | ||
|
||
test('Test with content attachment failed', async (t) => { | ||
qase.attach({ name: 'log.txt', content: 'Hello, World!', type: 'text/plain' }); | ||
await t.expect(false).ok(); | ||
}); | ||
|
||
test('Test with step attachment success', async (t) => { | ||
await qase.step('Step with attachment', async (s) => { | ||
s.attach({ name: 'log.txt', content: 'Hello, World!', type: 'text/plain' }); | ||
}); | ||
await t.expect(true).ok(); | ||
}); | ||
|
||
test('Test with step attachment failed', async (t) => { | ||
await qase.step('Step with attachment', async (s) => { | ||
s.attach({ name: 'log.txt', content: 'Hello, World!', type: 'text/plain' }); | ||
}); | ||
await t.expect(false).ok(); | ||
}); |
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,51 @@ | ||
import { test } from 'testcafe'; | ||
import { qase } from 'testcafe-reporter-qase/qase'; | ||
|
||
fixture`Simple tests` | ||
.page`http://devexpress.github.io/testcafe/example/`; | ||
|
||
test('Test without metadata success', async (t) => { | ||
await t.expect(true).ok(); | ||
}); | ||
|
||
test('Test without metadata failed', async (t) => { | ||
await t.expect(false).ok(); | ||
}); | ||
|
||
test.meta(qase.id(1).create())('Test with QaseID success', async t => { | ||
await t.expect(true).ok(); | ||
}); | ||
|
||
test.meta(qase.id(2).create())('Test with QaseID failed', async t => { | ||
await t.expect(false).ok(); | ||
}); | ||
|
||
test.meta(qase.title('Test with title success').create())('Test with title success', async t => { | ||
await t.expect(true).ok(); | ||
}); | ||
|
||
test.meta(qase.title('Test with title failed').create())('Test with title failed', async t => { | ||
await t.expect(false).ok(); | ||
}); | ||
|
||
test.meta(qase.fields({ | ||
'description': 'Test description', | ||
'preconditions': 'Some text', | ||
}).create())('Test with fields success', async t => { | ||
await t.expect(true).ok(); | ||
}); | ||
|
||
test.meta(qase.fields({ | ||
'description': 'Test description', | ||
'preconditions': 'Some text', | ||
}).create())('Test with fields failed', async t => { | ||
await t.expect(false).ok(); | ||
}); | ||
|
||
test.meta(qase.ignore().create())('Test with ignore success', async t => { | ||
await t.expect(true).ok(); | ||
}); | ||
|
||
test.meta(qase.ignore().create())('Test with ignore failed', async t => { | ||
await t.expect(false).ok(); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,3 +1,28 @@ | ||
# [email protected] | ||
|
||
## What's new | ||
|
||
Support `step` and `attach` methods for test cases. | ||
|
||
```javascript | ||
import { qase } from 'testcafe-qase-reporter/qase'; | ||
|
||
test('test', async (t) => { | ||
qase.attach({ name: 'attachment.txt', content: 'Hello, world!', contentType: 'text/plain' }); | ||
|
||
await qase.step('Step 1', async (s1) => { | ||
await s1.step('Step 1.1', async (s11) => { | ||
await s11.step('Step 1.1.1', async (s111) => { | ||
s11.attach({ name: 'attachment.txt', content: 'Hello, world!', contentType: 'text/plain' }); | ||
await s111.expect(true).ok(); | ||
}); | ||
}); | ||
await t.expect(true).ok(); | ||
}); | ||
await t.expect(true).ok(); | ||
}); | ||
``` | ||
|
||
# [email protected] | ||
|
||
## What's new | ||
|
Oops, something went wrong.