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

[RFR] Add End2End (E2E) tests #57

Merged
merged 16 commits into from
Mar 15, 2017
Merged

[RFR] Add End2End (E2E) tests #57

merged 16 commits into from
Mar 15, 2017

Conversation

jpetitcolas
Copy link
Contributor

@jpetitcolas jpetitcolas commented Sep 30, 2016

  • Bootstrap E2E testing
  • Implement pagination tests
  • Implement filter tests
  • Implement post creation / edition / delete tests
  • Set up Travis to run E2E tests
  • Find a way to prevent from driver.sleep
  • Test when clicking on menu item, browser should remember last query filters

});
});

describe.only('Filtering', () => {
Copy link
Member

Choose a reason for hiding this comment

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

.only() spotted

});

describe.only('Filtering', () => {
it('should display by default `alwaysOn` filters', function* () {
Copy link
Member

Choose a reason for hiding this comment

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

should display alwaysOn filters by default

describe.only('Filtering', () => {
it('should display by default `alwaysOn` filters', function* () {
yield driver.wait(until.elementLocated(ListPage.elements.filter('q')));
});
Copy link
Member

Choose a reason for hiding this comment

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

no assertion in this test

assert.equal(displayedPosts.length, 1);

const title = yield displayedPosts[0].findElement(webdriver.By.css('[data-source="title"]'));
assert.equal(yield title.getText(), 'Omnis voluptate enim similique est possimus');
Copy link
Member

Choose a reason for hiding this comment

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

This is why relying on a fixtures generator will be painful

@@ -0,0 +1,16 @@
'use strict';
Copy link
Member

Choose a reason for hiding this comment

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

Can't we use a simple node module for that, instead of rewriting the server ourselves?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We are using a very basic setup of express here.

Do you mean using just http-server for instance and launching it directly from command line? It would just move the "complexity" to the Makefile instead of this script IMO. :)

{ids.map(id => (
<TableRow key={id}>
{React.Children.toArray(children).map(field => (
<TableRowColumn key={`${id}-${field.props.source}`}>
<TableRowColumn key={`${id}-${field.props.source}`} data-source={field.props.source}>
Copy link
Member

Choose a reason for hiding this comment

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

Not a big fan of adding data attributes only for testing

@fzaninotto
Copy link
Member

Alternative approach suggested:

  • Ask the webdriver to navigate to a data URI that contains an empty HTML document (something like data:text/html,%3Cdiv+id%3D%22root%22%3E%3C%2Fdiv%3E, which translates to <div id="root"></div>)
  • In the before of each e2e test, ask the webdriver to load a custom JS function that actually configures the admin and load the test data (thanks to [RFR] Use Json REST client in example #208)
  • Look ma, no need for express anymore, no server required!

@fzaninotto
Copy link
Member

As explained in http://marmelab.com/blog/2017/01/04/e2e-selenium-no-server.html, my suggestion is feasible but not practical. We'll continue with your approach. I rebased the PR.

@fzaninotto fzaninotto changed the title [WIP] Add End2End (E2E) tests [RFR] Add End2End (E2E) tests Mar 15, 2017
@fzaninotto
Copy link
Member

Switching to RFR!

@djhi djhi merged commit 412d588 into next Mar 15, 2017
@djhi djhi deleted the e2e branch March 15, 2017 16:36
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.

3 participants