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

remove browser example and support for running in browser #1508

Merged
merged 8 commits into from
Dec 17, 2020

Conversation

charlierudolph
Copy link
Member

@charlierudolph charlierudolph commented Dec 9, 2020

Also removed build release which produced a browserified version of cucumber-js

Closes #1437

Copy link
Contributor

@davidjgoss davidjgoss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can also delete:

  • tsconfig.browser.json
  • dist from the files list in package.json
  • Reference to "and modern browsers" in the readme
  • Link to the running browser example in the readme? Or maybe keep until we have something compelling to replace it with?

Also think we should have a changelog entry under breaking

@davidjgoss davidjgoss added this to the 7.0.0 milestone Dec 11, 2020
package.json Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Member

@jbpros jbpros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we record the rationale behind the decision to remove browser support somewhere public? I wonder if some people will be surprised or even disappointed and would need an explanation about this change.

In fact, while I agree to drop support for browser runs, I could use a good write up of that decision myself. I still think we're closing a door to a feature without total assurance that it is not used much.

The upcoming disappearance of https://cucumber.github.io/cucumber-js/ is a bit of a shame, too (I guess it could be done server-side though).

CHANGELOG.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@jbpros
Copy link
Member

jbpros commented Dec 16, 2020

Are we taking https://cucumber.github.io/cucumber-js/ down, btw?

@davidjgoss
Copy link
Contributor

@jbpros

Are we taking https://cucumber.github.io/cucumber-js/ down, btw?

Good question. It does give a nice demo for new starters. Even with only Node.js supported I think we could make something similar happen with RunKit or some other server-side thing. Just a question of whether we leave it up in the meantime. I don't feel strongly either way.

@davidjgoss davidjgoss changed the title remove browser example remove browser example and support for running in browser Dec 16, 2020
@jbpros
Copy link
Member

jbpros commented Dec 17, 2020

@jbpros

Are we taking https://cucumber.github.io/cucumber-js/ down, btw?

Good question. It does give a nice demo for new starters. Even with only Node.js supported I think we could make something similar happen with RunKit or some other server-side thing. Just a question of whether we leave it up in the meantime. I don't feel strongly either way.

I suppose we can leave it at the moment, with the last supported version.

Copy link
Member

@jbpros jbpros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's good to go!

@davidjgoss davidjgoss merged commit 3975db7 into master Dec 17, 2020
@davidjgoss davidjgoss deleted the remove-browser-example branch December 17, 2020 15:33
@wa-citadel
Copy link

I wish this would have stayed or restructured as an optional feature. I think it should be improved, not removed.

@Taewa
Copy link

Taewa commented Jun 4, 2021

Hi @jbpros,
What you mentioned "remove browser support" means Cucumber used to provide a feature to run a testing on a browser (ex: headless Chrome) and now Cucumber stops supporting?

If the answer is yes, do you have any suggestion to run Cucumber testing on the browser?

In my case, I need Cucumber testing for FE app and it should be running on the browser due to my FE library expect a couple of window object methods.

Thanks in advance.

Should we record the rationale behind the decision to remove browser support somewhere public? I wonder if some people will be surprised or even disappointed and would need an explanation about this change.

In fact, while I agree to drop support for browser runs, I could use a good write up of that decision myself. I still think we're closing a door to a feature without total assurance that it is not used much.

@davidjgoss
Copy link
Contributor

@Taewa we removed the ability for cucumber-js itself (the test runner) to run in the browser, but you can absolutely use it to test browser-based software with webdriver, puppeteer, playwright etc as ever.

@Taewa
Copy link

Taewa commented Jun 4, 2021

Hi @davidjgoss thanks for the quick response.

I am aware of webdriver, puppeteer, playwright and I used to use WDIO.
However, I couldn't find a way to run my test with these tools.

Running e2e test fits well with these e2e tools. Like opening localhost:8000 and hit the test from beginning to end.
But my purpose is to test each single pages (or controllers) with cucumber.
It's like running test with Karma, Mocha, Chai

import { binding, given, then, when } from 'cucumber-tsflow';
import { fixture, html } from '@open-wc/testing';
import '../../src/SimpleGreeting.js';

@binding()
export class SimpleGreetingSteps {
  private element;

  @given('There is SimpleGreeting component')
  public async initComponent() {
    this.element = await fixture(
      html`
        <simple-greeting></simple-greeting>
      `,
    );
  }

  @when(/Start rendering/)
  public renderComponent() {
    this.element.render();
  }

  @then(/Name is rendered/)
  public assertResult() {
    // assert with mocha/chai
    expect(...)
  }
}

(I know I am using 3rd party cucumber plugin 'cucumber-tsflow' but this is what I want to run briefly on the browser)

In the above example, <simple-greeting> is a web component and I don't think it's possible to run test with e2e tools. I need to launch app first and let e2e tool navigate to the app.

However, I think it might be possible with Karma by running a browser. Just I don't know how to execute ./node_modules/.bin/cucumber-js inside of Karma.

If you know any other solution or suggestion or please correct me if my knowledge is wrong.

@Taewa
Copy link

Taewa commented Jun 4, 2021

@davidjgoss To add up, using Karma is an optional. My main intention is to use Cucumber (BDD) testing for individual web component.
Since I test web-component, it should be running on a browser.

Given "A customer who has an item X" // will be mocked
When "Navigate to item list page" // a web-component
Then "It should display an item X" 

As you can see there is no "customer login" pre-step.
It's just loading a web component and execute test with some mock data.
It's totally doable with current Karma/Mocha/Chai but Cucumber syntax would be much better to read/understand.

@sijakret
Copy link

@Taewa i am looking for pretty much the same thing - did you get anywhere?
I am trying to avoid using gherkin directly and then binding to step definitions directly or something like that.

PS: I got here digging through the docs and the issue tracker,
@jbpros the online demo without a note that it is based on an outdated version and ONLY for illustration purposes is definitely irritating. Took me some time to get here..

@Taewa
Copy link

Taewa commented Jul 28, 2021

Hi @sijakret
In the end, I took Cypress + CypressCucumber + Storybook. It work perfectly.

@Taewa i am looking for pretty much the same thing - did you get anywhere?
I am trying to avoid using gherkin directly and then binding to step definitions directly or something like that.

PS: I got here digging through the docs and the issue tracker,
@jbpros the online demo without a note that it is based on an outdated version and ONLY for illustration purposes is definitely irritating. Took me some time to get here..

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

Successfully merging this pull request may close these issues.

Remove browser example
6 participants