GithubHelp home page GithubHelp logo

Comments (6)

jan-molak avatar jan-molak commented on May 17, 2024 2

Hey @GeeChao, I've extracted the @serenity-js/core, which you can plug into any standard Mocha/Chai test. This should hopefully allow you to experiment with writing rest/db-specific abilities!

from serenity-js.

GeeChao avatar GeeChao commented on May 17, 2024 2

@jan-molak Awesome, that sounds great! will give it a go along with the cucumber framework to test rest services :)

from serenity-js.

jan-molak avatar jan-molak commented on May 17, 2024

Hi there,

At the moment Serenity/JS is initialised as a Protractor "framework", which puts Protractor in control of browser management. That's a good thing for UI-based tests, but not ideal for the REST-only ones.

I'm in a process of extracting the Serenity/JS core into a stand-alone module, which will support both #6 and #28 as well as your scenario out of the box. If you'd like to hack on it in the meantime though, then you could have a look at how serenity object is:

And plug it into your framework directly.

If you're running your integration tests with Mocha, it should be enough to create a mocha "reporter" that notifies Serenity/JS of test start/stop events and the test results. Probably something along those lines.

Does that help?

from serenity-js.

GeeChao avatar GeeChao commented on May 17, 2024

Hi Jan,

Thanks for your reply.

I will experiment a bit more, in the mean-time could I just create a second protractor.conf.js which doesn't include the browser type and capabilities etc. so it just won't spin up a new browser instance for my REST-API tests?

And then try to implement my journey design pattern to call a JS http request library as opposed to the BrowseTheWeb capability?

I would also prefer not to hack around with it as of yet I think it just creates additional problems in the future with the framework if you do new releases of Serenity-JS etc.

Thanks!

from serenity-js.

jan-molak avatar jan-molak commented on May 17, 2024

@bassie has started working on this feature in #131. I'll close this ticket so we can move this conversation to one place.

from serenity-js.

Baasie avatar Baasie commented on May 17, 2024

I moved this one to #134

from serenity-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.