Docs: https://serenity-js.org | Issues: https://github.com/serenity-js/serenity-js/issues | Backlog: https://github.com/orgs/serenity-js/projects
renovate[bot] on configure
Add renovate.json (compare)
dependabot[bot] on npm_and_yarn
chore(deps): bump chai from 4.3… (compare)
dependabot[bot] on npm_and_yarn
chore(deps-dev): bump lerna fro… (compare)
jan-molak on gh-pages
Updates (compare)
jan-molak on master
Update the-trouble-with-test-sc… Merge pull request #743 from ma… (compare)
Hey all
I am currently rebuilding the serenity html report to a more "modern" single page application. I would appreciate your feedback on the demo https://lemon-desert-049177e03.azurestaticapps.net/
Hey folks, 2.18.0 is out!
Actors can be used in beforeAll
/afterAll
-style hooks of your favourite test framework.
This means that you can, for example, have an actor that spins up a server that keeps running throughout the entire test suite execution.
You can also share notes between actors instantiated in beforeAll
, before
and within a test method using the ability to TakeNotes.usingASharedNotepad
Also, any Discardable
abilities that an actor has been given will be discarded:
beforeEach
-style hook or within a scenariobeforeAll
-style hookThis release also removes several deprecated APIs:
Serenity#setTheStage(...stageCrewMembers: StageCrewMember[]): void
- use configure
Serenity#callToStageFor(actors: Cast): Stage
- use engage
Stage#callFor(actors: Cast): Stage
- use actorCalled
and [actorInTheSpotlight
]https://serenity-js.org/modules/core/function/index.html#static-function-actorInTheSpotlight()Actor.named(name: string): Actor
- use actorCalled
describe('Serenity/JS 2.18.0', () => {
before(() =>
actorCalled('Alice')
.whoCan(
ManageALocalServer.runningAHttpListener(app),
TakeNotes.usingASharedNotepad(),
)
.attemptsTo(
StartLocalServer.onRandomPort(),
TakeNote.of(LocalServer.url())
));
beforeEach(() =>
actorCalled('Bob')
.whoCan(
BrowseTheWeb.using(protractor.browser),
TakeNotes.usingASharedNotepad(),
));
it(`lets actors perform in “before all” hooks and share notes across test scenarios`, () =>
actorCalled('Bob').attemptsTo(
Navigate.to(Note.of(LocalServer.url()))
// ...
));
});
ArtifactArchiver.storingArtifactsAt('./target/site/serenity')
WARNING: An illegal reflective access operation has occurred
- Is this common ?
Error: Error: Cannot find module 'unicode-13.0.0/Binary_Property/ID_Start/code-points.js'
- Is this somehow connected to the serenityJS framework?
Hey folks! Serenity/JS 2.19 adds two new interfaces to Abilities: Initialisable and Discardable.
Any custom Abilities you create that implement those interfaces will be initialised by Serenity/JS before the actor starts to perform their activities, and discarded when the scenario finishes (if the actor was instantiated in scenario scope), or when the entire test run finishes (if the actor was initialised in beforeAll
-style hook).
Here's an example of using those new features to make a Serenity/JS test interact with a PostgreSQL DB - https://serenity-js.org/modules/core/class/src/screenplay/Ability.ts~Ability.html
Take this new version for a spin and let me know what you think :-) I can't wait to see what you integrate your tests with!
Hi folks - new supporter here migrating over from the Java world of Serenity BDD. Very thankful this project exists - I've just started incorporating it as my REST integration test step in a Kubernetes microservice build pipeline.
I wanted to ask what do you find is the best approach to pass in the base URL for REST tests in this kind of scenario where the URL is not known ahead of time? For now I'm going to extract it from an environment variable and default to localhost:8080 but wondered if there was more sophisticated handling for REST defaults, etc. Thanks!
CallAnApi
ability.
const ScenarioName = (scenario: HookScenarioResult) =>
Question.about('The name of the scenario', actor => scenario.pickle.name);
Before( scenario => actorCalled('User').attemptsTo(
MaximizeBrowser.start(),
TakeNote.of(ScenarioName(scenario)).as('scenarioName'),
));
// code in an async interaction gets the name to use
const scenarioName: string = await actorCalled('User').answer(Note.of('scenarioName'));
Hey folks! I've added a neat little Question
in version 2.19.5, it's called q
and works just like string templates, but with other Serenity/JS questions:
import { q, actorCalled } from '@serenity-js/core';
import { Send, DeleteRequest } from '@serenity-js/rest';
actorCalled('Alice').attemptsTo(
Send.a(DeleteRequest.to(
q `/articles/${ Text.of(Article.id()) }`
))
)
Thoughts and feedback welcome!
Hi, is there a #result or something that can be used in the question string to display value of the question? i can only see #actor... i am trying to write a question that can be chained like tasks
class DateText extends Question {
static of(target) {
return new DateText(target);
}
as(dateFormat) {
this.dateFormat = dateFormat;
return this;
}
constructor(target) {
super();
this.target = target;
}
async performAs(actor) {
/*more fancy stuff here*/
const result = '2020/12/15';
return result;
}
}
but without toString method this throws and exception in formatter. If i return const string then it is being used in the calling Ensure as value...