New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Photographer sometimes takes photos of wrong browser #1340
Comments
Hi @xela1601! The If this is not the behaviour you're seeing, it would be really helpful if you could try and reproduce the issue using one of the official Serenity/JS templates, for example, this one with Serenity/JS, Cucumber and WebdriverIO (if you're using the latest Serenity/JS 3.0 please use the If you're saying that this issue happens only sporadically and non-deterministically, my first suspicion would be synchronisation - in particular, remember to always For example: Given('{actor} and {actor}', async (actor1: Actor, actor2: Actor) => {
await actor1.attemptsTo(...);
await actor2.attemptsTo(...);
}) |
Hey @jan-molak and thanks for reaching back, I guess the error would principally occur all the time but it is failing non-deterministic, so we also see the wrong screenshots non-deterministically (because they are only being made when there's a failed test instruction). However I wanted to share the code of the failing Interaction. Wait.upTo(Duration.ofSeconds(config.defaultE2ETimeout)).until(
Question.about(
`most recent cart product exists as basket changed item in history of session monitor details`,
async (actor) => {
const scannedItem = await Basket.mostRecentItemModel().answeredBy(actorCalled(Actors.Customer));
const historyItems = await SessionMonitorDetails.GetHistoryItems().answeredBy(actor);
const basketChangedItems = historyItems.filter((item) => item instanceof BasketChangeItem) as BasketChangeItem[];
const match = basketChangedItems.find(
async (item) =>
(await item.name().answeredBy(actor)) === scannedItem.name &&
(await item.totalAmount().answeredBy(actor)) === scannedItem.amount,
);
if (match) {
const changedAmount = await match.changedAmount().answeredBy(actor);
await Log.the(
`Found matching history item for scanned item "${scannedItem.toString()}" with +${changedAmount} increase`,
).performAs(actor);
return true;
}
return false;
},
),
isTrue(),
) Maybe this helps to resolve the issue. Kind regards |
Hello serenity team,
we're using webdriverio, serenity-js & cucumber for our testing and have 2 Actors "Customer" and "StoreManager" which are using their own browsers respectively. The Photographer is configured in a way, where he only takes Photos/Screenshots when some instruction is failing. Somehow we have some scenario which is failing from time to time which involves both actors and fails at an instruction of the StoreManager but takes an Photo of the Customer's browser.
Is this a bug or do we maybe have configured something wrong?
Let me know if you need any further information. Thanks alot!
The text was updated successfully, but these errors were encountered: