Skip to content
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

serenity-js for rest/db/appium #40

Closed
GeeChao opened this issue May 11, 2017 · 6 comments
Closed

serenity-js for rest/db/appium #40

GeeChao opened this issue May 11, 2017 · 6 comments

Comments

@GeeChao
Copy link

@GeeChao GeeChao commented May 11, 2017

Hi all,

I have followed the tutorial and played around with serenity-js and have found it differs quite greatly from the serenity-bdd Java version.

One thing I haven't figured out how to do yet, is how to create test scenarios with cucumber-js that doesn't automatically instantiate protractor and a browser for each scenario.

As I'd like to use serenity-js for both our integration and acceptance tests, although I don't want it to instantiate protractor and open chrome etc. for the integration tests that only test REST-API.

Could anyone shed some light on this please?

Thanks and regards.

@jan-molak
Copy link
Member

@jan-molak jan-molak commented May 11, 2017

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?

@GeeChao
Copy link
Author

@GeeChao GeeChao commented May 12, 2017

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!

jan-molak added a commit that referenced this issue May 20, 2017
affects: @serenity-js/core

First step towards supporting #40 and #6
@jan-molak jan-molak added the ready label Jun 9, 2017
@jan-molak
Copy link
Member

@jan-molak jan-molak commented Jun 13, 2017

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!

@GeeChao
Copy link
Author

@GeeChao GeeChao commented Jun 15, 2017

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

@jan-molak
Copy link
Member

@jan-molak jan-molak commented Dec 16, 2017

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

@jan-molak jan-molak closed this Dec 16, 2017
@jan-molak jan-molak removed the ready label Dec 16, 2017
@Baasie
Copy link

@Baasie Baasie commented Dec 18, 2017

I moved this one to #134

jan-molak added a commit that referenced this issue Dec 21, 2017
…based HTTP APIs

affects: @serenity-js/rest

Thanks to @Baasie for teaching Serenity/JS some new tricks!

ISSUES CLOSED: #134, #40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants