Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 15:05
    renovate[bot] edited #976
  • May 25 23:05
    renovate[bot] edited #1065
  • May 25 23:05
    renovate[bot] edited #1215
  • May 25 23:05
    renovate[bot] edited #1214
  • May 25 23:04
    renovate[bot] edited #1191
  • May 25 23:04
    renovate[bot] edited #1213
  • May 25 23:04
    renovate[bot] edited #1177
  • May 25 23:04
    renovate[bot] edited #1211
  • May 25 23:04
    renovate[bot] edited #1210
  • May 25 23:03
    renovate[bot] edited #1212
  • May 25 23:03
    renovate[bot] edited #1033
  • May 25 16:41
    renovate[bot] edited #976
  • May 25 16:39
    renovate[bot] edited #1211
  • May 25 16:39
    renovate[bot] edited #1211
  • May 25 16:39
    renovate[bot] synchronize #1211
  • May 25 16:39

    renovate[bot] on babel-monorepo

    fix(deps): update dependency @b… (compare)

  • May 25 13:34
    renovate[bot] edited #976
  • May 25 13:34
    renovate[bot] edited #1065
  • May 25 13:34
    renovate[bot] edited #1215
  • May 25 13:34
    renovate[bot] edited #1214
Lay Mui
@LayMui
using the new serenityJS version 3, ^3.0.0-rc.6, the locator strategy was not working
34 replies
Amit Sharma
@asharm45
Start.png

Hi Team, I have imported project template "protractor-jasmine-todomvc" in Visual Studio Code but when I try to run Start.ts using npx ts-node Start.ts command I am getting:

node:internal/modules/cjs/loader:936
throw err;
^

Error: Cannot find module './Start.ts'
Require stack:

  • /Users/as/Downloads/serenity-js-master/examples/protractor-jasmine-todomvc/spec/support/imaginaryUncacheableRequireResolveScript
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.resolve (node:internal/modules/cjs/helpers:108:19)
    at requireResolveNonCached (/Users/as
    /Downloads/serenity-js-master/examples/protractor-jasmine-todomvc/node_modules/ts-node/dist/bin.js:321:16)
    at getProjectSearchDir (/Users/as/Downloads/serenity-js-master/examples/protractor-jasmine-todomvc/node_modules/ts-node/dist/bin.js:291:40)
    at main (/Users/as
    /Downloads/serenity-js-master/examples/protractor-jasmine-todomvc/node_modules/ts-node/dist/bin.js:193:27)
    at Object.<anonymous> (/Users/as/Downloads/serenity-js-master/examples/protractor-jasmine-todomvc/node_modules/ts-node/dist/bin.js:351:5)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    '/Users/as
    /Downloads/serenity-js-master/examples/protractor-jasmine-todomvc/spec/support/imaginaryUncacheableRequireResolveScript'
    ]
    }
8 replies
Jan Molak
@jan-molak

Hey Folks! 3.0.0-rc.7 is now available with a bunch of fixes and several new features, please see changelog

The big highlight:

You can now check if Page, ModalDialog, PageElement, or any field of any object returned by Question.about is present in a consistent way, thanks to a new interface - Optional

For example Ensure.that(ModalDialog.window(), isPresent()), Ensure.that(LastResponse.body().books[0].authors.name, isPresent()), Wait.until(PageElement, isPresent()), etc

Please take 3.0.0-rc.7 for a spin and let me know what you think!

Also, if you haven't already, please add your team / company to the list of all the awesome places using Serenity/JS :) serenity-js/serenity-js#898

Lay Mui
@LayMui
@jan-molak the serenityJS page locator does not work for mobile automation. I have used only webdriverio + cucumber (without serenityJS) and it's working fine
2 replies
Jan Molak
@jan-molak

Hey folks! I'm exploring ways to improve how Serenity/JS selectors work and need your help!

Could you please take a couple of minutes to answer this short survey?

https://forms.gle/CGebfBPwKJQHkXr69

Thank you! :bow:

Lokesh Babu Mani
@lokezhbabuofficial
@jan-molak I'm up to migrating one of our serenity-js 2.x.x (protractor + cucumber) to serenity-js 2.x.x (webdriver + cucumber). Will there be any major changes.?
39 replies
Lokesh Babu Mani
@lokezhbabuofficial
also do I was checking the side do you have any side branch reference for this.?
Serenity/JS, Cucumber, and WebdriverIO template (coming soon!)
Jan Molak
@jan-molak

Hey folks! I'm continuing to expand the Serenity/JS 3.0 migration guide at serenity-js/serenity-js#1100

Thoughts, feedback and questions are welcome!

Jan Molak
@jan-molak

Hey folks, Serenity/JS 3.0.0-rc.9 is now available on npm

Highlights:

  • isVisible() works with elements in Shadow DOM
  • By.css can be prefixed with >>> to locate elements in Shadow DOM - e.g. By.css('>>>div.info')); This works with both Protractor and WebdriverIO integrations.
38 replies
Jimmy Rodriguez
@Jidarofa
Hello @jan-molak I'm new here... Sorry I can't to do DragandDrop with cucumber+webdriver.io any suggestion??
21 replies
Jan Molak
@jan-molak

Hi all, I've just released protractor-cucumber-framework version 8.3.0 with Serenity/JS 2.33.0.
This release fixes an issue that prevented limiting the execution of test scenarios by line number a given scenario is on. See protractor-cucumber-framework/protractor-cucumber-framework#238

I'll merge the fix to 3.0.0-rc shortly too

1 reply
gigamac
@gigamac
we are using rest to return an html fragment as a raw reply string that contains 2 javascript tags - i want to ensure the response contains the tags, and the tags contain some objects that confirm the request has processed. The alternative would by just checking strings are included and hoping all is ok, or else being stricter about the unit tests building the tags correctly. My preference is arguing the unit tests confirm proper tags are built, and also checking tag ids in the response.
My problem is finding the right modules to import to see the lastresponse body as html tags, from there I guess I can figure out the howto, or scream again. How would I set this up? I dont think I can navigate as its a REST request...
17 replies
Lay Mui
@LayMui
How can get the farmerLocationCropId value from the response body?
The following code snippet does not work after I upgrade to serenityJS 3.0.0-rc.10
21 replies
gigamac
@gigamac

Hi - I just made a problem, and am wondering if I simply should have done something different....:
I wanted to keep the bdd simple, while under the hood stuffs got done so I made:
When Terry gets the stuff api Then he should see a "DIV" tag id "testTagId" with values | stringValue | | stuffs: "stringyStuffs" | | otherStuffs: "thingyStuffs" |

with more going on in the step to check specifically the tag is right and it has some expected strings (i know i could probably forego the id check and just use the tag check but thats not my question):

    '{pronoun} should see a {string} tag id {string} with values',
    (pronoun, expectedTag, tagId, tableOfStrings: DataTable) => {
        pronoun.attemptsTo(
            Ensure.that(
                LastResponse.body<string>().describedAs(`the fragment has a tag ${tagId}`).map(
                    () => (body) => JSDOM.fragment(body).getElementById(tagId),
                ),
                not(equals(null)),
            ),
            Ensure.that(
                LastResponse.body<string>().describedAs(`the tag ${tagId} is a ${expectedTag} tag`).map(
                    () => (body) => JSDOM.fragment(body).getElementById(tagId).tagName,
                ),
                includes(expectedTag),
            ),        
            tableOfStrings.rows().forEach((row) => {
                    Ensure.that(
                        LastResponse.body<string>().describedAs(`${tagId} has string`).map(
                            () => (body) => JSDOM.fragment(body).getElementById(tagId).textContent,
                        ),
                        includes(row[0]),
                    )
            }),
            )
        },
);

This passes the test, and the report looks ok (though it reports the last ensure first), but there is a problem summarising to the console, and I think its caused by the last ensure with an iteration through the table:
✓ Execution successful (95ms) [ser:test:execute] ✓ Terry ensures that the tag testTagId is a SCRIPT tag does include 'SCRIPT' (14ms) [ser:test:execute] /pathToProject/node_modules/@serenity-js/core/src/screenplay/activities/ActivityDescriber.ts:8 [ser:test:execute] const template = activity.toString() !== ({}).toString() [ser:test:execute] ^ [ser:test:execute] TypeError: Cannot read properties of undefined (reading 'toString') [ser:test:execute] at ActivityDescriber.describe (/pathToProject/node_modules/@serenity-js/core/src/screenplay/activities/ActivityDescriber.ts:8:35) [ser:test:execute] at TrackedActivity.performAs (/pathToProject/node_modules/@serenity-js/core/src/screenplay/activities/TrackedActivity.ts:26:69) [ser:test:execute] at /pathToProject/node_modules/@serenity-js/core/src/screenplay/actor/Actor.ts:72:40 { [ser:test:execute] [Symbol(originalCallSite)]: [ CallSite {}, CallSite {}, CallSite {} ], [ser:test:execute] [Symbol(mutatedCallSite)]: [ CallSite {}, CallSite {}, CallSite {} ] [ser:test:execute] } [failsafe] Script 'ser:test:execute' exited with code 1 [ser:test:report] [ser:test:report] > projectName@1.0.0 ser:test:report [ser:test:report] > serenity-bdd run --features ./features

If I have te table check as a separate pronoun.attemptsTo(...) in the same step, it seems ok.... Thoughts?

Lay Mui
@LayMui
@jan-molak does serenityjs-web module has this API called TakeScreenshot?
10 replies
Jan Molak
@jan-molak

Hey folks, Serenity/JS 3.0.0-rc.11 is now available! 🎉🎉🎉

It brings you:

For example, you can now easily switch to an iframe, perform a sequence of interactions, and then Serenity will switch you back when you're done. No need to mess about with having to remember about parent frames:

            actorCalled('Francesca').attemptsTo(
                Navigate.to('/screenplay/models/frame/page_with_an_iframe.html'),
                Ensure.that(Text.of(heading), equals('Page with an iframe')),

                Switch.to(Frame.located(By.css('iframe'))).and(
                    Ensure.that(Text.of(heading), equals('An iframe')),
                ),

                Ensure.that(Text.of(heading), equals('Page with an iframe')),
            )

And it works for switching between windows/tabs too!

                actorCalled('Bernie').attemptsTo(
                    Click.on(MainPage.newTabLink),

                    Wait.until(Page.whichTitle(equals(NewTab.title)), isPresent()),

                    // click automatically switches context,
                    // so make sure we're on the main page
                    Switch.to(Page.whichTitle(equals(MainPage.title))),

                    Switch.to(Page.whichTitle(equals(NewTab.title))).and(
                        Ensure.that(heading, equals(NewTab.heading)),
                    ),

                    Ensure.that(Page.current().title(), equals(MainPage.title)),
                ));

Thoughts and feedback are welcome!

Lay Mui
@LayMui
I got TypeError: Cannot read properties of undefined (reading 'attemptsTo') when I use serenityjs-webdriverio + cucumber testrunner for the mobile automation
17 replies
Juan Francisco Builes Montoya
@juanfranciscobumo
Hi, good morning, i have a question, if i have a target with this example //ytd-video-renderer/div/div/div/div/h3/a/yt-formatted-string[contains(text(),'{0}')], how can i set the value in the target, in serenity with java i can set it with Target.of but in serenity.js don't work
16 replies
Lay Mui
@LayMui
I got a ConfigurationError: Jan can't BrowseTheWeb yet. Did you give them the ability to do so?
57 replies
Lokesh Babu Mani
@lokezhbabuofficial
@jan-molak I'm using serenity 2.* with protractor and cucumber. I'm trying to achieve a scenario like on a button click based on the url I have to call different feature file to execute. Do you think its possible

Like for example,

I have a task something like,

Check.whether(URL, isequal('step-1')).andIfSo(execute('__dir/step-1.feature')) // execute will accept the location for the feature file and start executing it
41 replies
Lay Mui
@LayMui
how can I used PageElement to express this DOM structure
3 replies
Lay Mui
@LayMui
test hang using PageElement by.id, test console stuck at test:execute] Execution of 1 workers started at 2022-02-17T06:22:19.179Z
[test:execute]
[test:execute] [0-0] RUNNING in chrome - /features/fillUpForm.feature
5 replies
eyesopen
@eyesopen
Hi,
I am trying to write Expectation that needs to execute a Task. Any advise how can i achieve that?
isGreen: () => Expectation.thatActualShould('become green', 'become green').soThat(actualValue =>
    Attribute.of(actualValue).called('color-indication'), includes('i-am-green')
  ),
11 replies
Jimmy Rodriguez
@Jidarofa
Hello @jan-molak , I'm using rest to validate some call apis, but I can't access to any specific data of response to start a new call, example: I have api/create and I need save the "Id" that return to execute this call and I need execute other api example: api/consult/{id} this {id} is that the first call api but I can't save this value to reuse in the second api call... can you help me??
32 replies
Jan Molak
@jan-molak

Hey folks! Applitools are hosting a free Future of Testing conference today, and @wakaleo and I will be talking about the Screenplay pattern and some of the new features in Serenity BDD (Java)
If you have a moment to tune in about at 1:45 UTC, please feel free to join us :)

Registration:
https://applitools.com/future-of-testing-frameworks-2022/

2 replies
Lay Mui
@LayMui
how to get Text from Span Tag using serenityJS's PageElement?
7 replies
Jimmy Rodriguez
@Jidarofa

Hello @jan-molak I'm doing Api testing and I need save values of diferentes request to use it after, example: I need to save Id of my first request but I need use this Id in the second request as a parameter... I read about take notes but those take notes save values but in the same context of the first request but when I want to use Id in the second request my note using Note.of say that not exist.

Are there any way to answer my problem? Thanks!

7 replies
Dennis Kraft
@Iv3x

Hi,
i am actually working on a poc implementing serenity-js into our existing cucumber webdriverio project. I noticed that the Photographer actually only work on screenplay tests and researched about a work around for webdriver.io legacy tests. So I did the following after finding an issue about this from @jan-molak :

const { After } = require('@cucumber/cucumber');
const { actorCalled } = require('@serenity-js/core');
const { Check, equals } = require('@serenity-js/assertions');
const { TakeScreenshot } = require('@serenity-js/web');

After(scenario => actorCalled('Inspector').attemptsTo(
    Check.whether(scenario.result.status, equals('failed'))
        .andIfSo(TakeScreenshot(scenario.pickle.name))
));

But actually i dont get it to make a screenshot but i already find out that it actually get reached by the code on failure with a console.log. Is there something i am missing or did someone manage to make webdriver.io take a Screenshot somehow ? :-) Thx in advance for any help and sorry for the long post :D

46 replies
Jan Molak
@jan-molak

Hey folks, 3.0.0-rc.13 is now available!

Most notable changes:

  • I've merged Frame and PageElement models and removed Frame
  • This means that you can now use the interaction to Switch.to(...) with any PageElement. If that PageElement is a frame or iframe, calling Switch.to(PageElement.located(By.css('frame')) results in switching the top-level browsing context to that frame. If that element is any regular Web element, like input, Switch.to(element) will set focus on that element.

Check out the examples and let me know what you think!

Jimmy Rodriguez
@Jidarofa
Hello, I'm using webdriver.io with cucumber but I have a little problem.. is when I do any action, my browser refresh it and my test finish but I need continue doing validations.. What I do in that case?
14 replies
Dennis Kraft
@Iv3x
Hi, actually have seen if you use the retry cucumber flag with webdriverio it did the retry but reported the the failed test anyway on the cli report wich let CI/CD then fail anyway. Is there way/option to dont report failed first attempts ?
12 replies
gigamac
@gigamac
just tried updating serenity-js-cucumber-template to 3.0.0-rc.13 from 2.33.0 and broke bot the property import (not found in assertions) and the promise for float '{pronoun} should get {float}' Argument of type 'QuestionAdapter<Promise<number>>' is not assignable to parameter of type 'Answerable<number>'. Type 'QuestionAdapter<Promise<number>>' is not assignable to type 'Question<number>'. The types returned by 'describedAs(...).answeredBy(...)' are incompatible between these types. Type 'Promise<Promise<number>>' is not assignable to type 'number'.ts(2345) - could do with some help on correctign this - have looked and can't really find the answer to these...
Jan Molak
@jan-molak
Hey @gigamac, try changing QuestionAdapter<Promise<number>> to QuestionAdapter<number> (on my phone, so apologies for the formatting 😉)
38 replies
Dennis Kraft
@Iv3x

Hi together, did someone have an idea what can cause this error from serenity-bdd ? t] Mar 15, 2022 11:41:32 AM freemarker.log._JULLoggerFactory$JULLogger error [test:report] 11:41:33.104 [pool-2-thread-3] WARN n.t.c.r.t.FreemarkerReportTemplate - Report generation failed [test:report] freemarker.core.InvalidReferenceException: The following has evaluated to null or missing: [test:report] ==> row.result [in template "freemarker/default.ftl" at line 329, column 43] [test:report]

actually I can see it creates all the screenshots and its using an after hook for it since its legacy wdio. and also its working without issue for some tests

5 replies
Jan Molak
@jan-molak

Hey folks, I'm thinking of combining interactions to Press and Enter and introducing a new one along the lines of Type.text(valueOrKeyboardShortcuts).into(field)

Please share your thoughts under serenity-js/serenity-js#1148

5 replies
Manuel Fidalgo Sicilia
@manuelfidalgo

Hi @jan-molak , how you doing?
I'm currently using Serenity/JS 2.32.5 with wdio and Jasmine and I have seen some strange behavior with beforeAll method.
I created a simplified version of my code:

import { actorCalled, Log } from "@serenity-js/core";
import { ACTOR } from "./actors";

describe(`My Serenity Suite`, () => {
    beforeAll(async function () {
        console.log("Serenity beforeAll");
        //unless we remove the following await, test #2 never gets executed
        await actorCalled(ACTOR.ADMIN).attemptsTo(Log.the("Serenity BeforeAll"));
    });

    afterAll(async function () {
        console.log("Serenity afterAll");
        await actorCalled(ACTOR.MANAGER).attemptsTo(Log.the("Serenity afterAll"));
    });

    it("Test #1", function () {
        console.log("Serenity test #1");
    });

    it("Test #2", function () {
        console.log("Serenity test #2");
    });
});

the output is:
[0-0] RUNNING in chrome - /test/specs/jasmine-serenity-problem.spec.ts
[0-0] Serenity beforeAll
[0-0] Serenity test #1
[0-0] Serenity afterAll
[0-0] PASSED in chrome - /test/specs/jasmine-serenity-problem.spec.ts

So, test #2 NEVER gets executed.
If I remove the "await" in the beforeAll, everything works properly and, if I replace beforeAll-->beforeEach works fine, so I guess is a problem of the await in the beforeAll method.
Do you think this is a bug? Do you any kind of test related to this?

22 replies
Jan Molak
@jan-molak

Hey folks, as I'm working on Chapter 13 of "BDD in Action, second edition", dedicated to Serenity/JS, I noticed that there's a number of improvements I could make around the ability to TakeNotes and Notes in general.

I've described my ideas here, so let me know what you think about them and if there's anything else that you'd like to see improved in that area - serenity-js/serenity-js#817

eyesopen
@eyesopen
hi, i have a dynamic QR image displayed on the page i am testing. Originally i thought it would be enough to verify that it is visible, but if the img tag fails to load its content, will isVisible() detect it and fail the test? alternatively i was considering to read the QR instead, but i dont know if that is possible using serenity-js 2? Anyone could advise on how could i test this?
7 replies
eyesopen
@eyesopen
i would like to inquire about the internal performAs method behavior. sometimes i have actions that are executed before actor.attemptsTo(...). If these actions were to cause exception (like setting cookie to browser) the execution is aborted and no more tests are run. Should i try-catch actions executed not in attemptsTo?
Another thing - what is the correct way to gracefully interrupt performAs execution? should i just "return;"? return promise.reject?
62 replies
gigamac
@gigamac
recently I started getting Make sure to perform a HTTP API call before checking on the response while upgrading some tests from 2.33.0 to 3.0.0-rc.13 ... - I am still using the same actor declarations and steps, just changing the ensures. I tried creating a new project just to work through some of the issues, and can't see what I can be doing differently to cause this....
55 replies
Jan Molak
@jan-molak

Hey all, I've just published Serenity/JS 2.33.5 (changelog) and 3.0.0-rc.15 (changelog)

Slowly finishing up on version 3 and getting it ready for prime time. Thanks a million for your help and support!

Jan Molak
@jan-molak

Hey /@all! I've just released 3.0.0-rc.16 with a completely rewritten ability to TakeNotes, question about Note, and interaction to TakeNote. The new implementation provides better type safety, an easy way to instantiate a notepad with some initial state, and take advantage of the new QuestionAdapter APIs.

Please have a look at the migration guide at serenity-js/serenity-js#1100 and let me know if you have any questions or feedback!

Take care and Happy Easter :-)

Usman Sheriff
@UsmanSh39021444_twitter

statement from the serenity/js website: Serenity/JS comes with over 100 building blocks to help you create high-quality automated acceptance tests interacting with Web apps, REST APIs, and more.

question:

  1. what are those 100 building blocks? what actually they are?
  2. can we use for mobile automation? if yes, how?

statement from the serenity/js website: Serenity/JS is easy to extend, so there are no limits to what you can test!

question:

  1. how you are saying that it is easy to extend? in what way it can be extended?

statement from the serenity/js website: Serenity/JS supercharges Jasmine, Mocha, Cucumber, Protractor, and WebdriverIO with capabilities to produce in-depth reports and living documentation that make failure analysis and release readiness assessment much more efficient.

question:

  1. how it supercharges?
9 replies
Lay Mui
@LayMui
@jan-molak I got this error in the CI where there is a timeout issue, this is using serenityJS-rest
27 replies
Lay Mui
@LayMui
@jan-molak the serenityBDD report does not work for mobile automation with serenityjs-webdriverio framework.
118 replies
viper3400
@viper3400

HI @jan-molak , I'm in trouble with your latest change for Note in 3.0.0-rc.16:

I was using an actor.whoCan(TakeNotes.usingASharedNotepad(). All my actor.named('some-name')s used this Actor.

I took generic notes with a dynamic subject, like

TakeNote.of(
    Value.of(PageElementAValue)))
         .as('dynamic subject A'),
TakeNote.of(
    Value.of(PageElementBValue))
         .as('dynamic subject B')

and then every actor could acces this note

Log.the('note of dynamic subject', Note.of('dynamic subjectA)),
Log.the('note of dynamic subject', Note.of('dynamic subjectB)),

Now I'm stuck with the new implementation. I have to init a shared notepad with an interface. In your examples it it is

// initialise a shared notepad when the Actors class is initialised
private readonly sharedNotepad = Notepad.with<AuthCredentials>({
     username: 'test-user',
     password: 'SuperSecretP@ssword!',
});

In my case it would be empty at the beginning, because I want to fill it later

// initialise a shared notepad when the Actors class is initialised
private readonly sharedNotepad = Notepad.with<AuthCredentials>({});

and I want not just one set of username and password, but different instances of this value pair. How can I achieve this?

88 replies
Jan Molak
@jan-molak

Hey @/all!

@viper3400 and I are busy working on updating the docs and templates to help you get started with Serenity/JS 3.0

Please check out the updated migration guide, take the new templates for a spin, and let us know what you think!

https://serenity-js.org/handbook/release-notes/index.html

1 reply
viper3400
@viper3400
Hi @jan-molak , next challenge for me, using @serenity-js/rest, trying to send an authenticated POST request with headers of the response from a previous GET request.
121 replies