How to Serenity.js & AsciiDoc as alternative to Cucumber with instant LivingDoc 😉 #2549
Unanswered
qwertysk
asked this question in
How to... ?
Replies: 1 comment 4 replies
-
Hi @qwertysk I like the AsciiDoc output, thanks for sharing your idea! I think expressing test scenarios in a type-safe way using string templates might be quite tricky. I'm also not sure if this authoring model could allow for code completion like you have with Cucumber Gherkin files, or regular JavaScript or TypeScript. To help me understand your idea better, what's the main benefit or expressing a test scenario like this: ////
import { test } from '@serenity-js/playwright-test'
import { Ensure, contain } from '@serenity-js/assertions'
import { Goto, EnterAndConfirm, Address} from './someImpl'
////
test('Entry without permissions is denied', async ({ Actor, Entry }) => { await Actor `
. ${Goto} the entrance of the System ${{Address: 'sys.tem'}} ``
. ${EnterAndConfirm} invalid permissions for ${Entry}
${{
Name: 'KO',
Password: 'attempt',
action: 'Sign in'
}} ``
. ${Ensure} that the denial of ${Entry} ${contain} reason and possible (re)actions
${{
Error: 'Invalid permissions',
actions: ['Register', 'Reset password', 'Sign in']
}} ``
`
}); Instead of using code, for example: test('Entry without permissions is denied', async ({ actor }) => {
await actor.attemptsTo(
Navigate.to('https://my-system.com'),
Login.using({
name: 'KO',
password: 'attempt',
action: 'Sign in',
}),
Ensure.that(Login.error(), equals({
error: 'Invalid permissions',
actions: ['Register', 'Reset password', 'Sign in']
}),
);
); If you like AsciiDoc output, have you considered writing a custom reporter? Or are you looking for enabling a different authoring experience? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi guys,
what do you think about idea to have Actor also as chainable tagged template literal?
This can result to type safe executable DSL (without Cucumber regex step definitions) with instant Living Documentation preview ...
Pls, how to achieve this?
@jan-molak would that be a benefit for serenity.js core (pls see zip with prototype at the end)?
Regards,
Stefan
Hints to reproduce results:
0. Extract serentity-prototype.zip and open it in VS Code
Beta Was this translation helpful? Give feedback.
All reactions