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

fix(ci): Migrate acceptance tests from Webdriver to Cypress #301

Merged

Conversation

adrienjoly
Copy link
Member

@adrienjoly adrienjoly commented Mar 21, 2020

Contributes to #199.

@adrienjoly adrienjoly self-assigned this Mar 21, 2020
@adrienjoly adrienjoly added this to 📥 Inbox / ideas in Development via automation Mar 21, 2020
@adrienjoly adrienjoly moved this from 📥 Inbox / ideas to ⚙ In progress in Development Mar 21, 2020
…et test suite login after the call to dbReset
adrienjoly added a commit that referenced this pull request Mar 22, 2020
Extracted from PR #301.

Contributes to #199.

## What does this PR do / solve?

Cypress' best practices recommend to start each test with a clean server state.

## Overview of changes

Instead of seeding the database before running Cypress, we let it do that before running every test.

As a result this PR:
- introduces a new `POST /testing/reset` API endpoint that clears the db and re-populates it with test data
- removes calls to `npm run test-reset`
- extracts the db initialization logic from `app.js` to `mongodb.js`
- also takes that opportunity to extract `cacheCollections()` and `runShellScript()` out of `mongodb.js`'s `init()` function

## How to test this PR?

CI should pass.

Locally, you should be able to run all tests more than once in a row, using `$ npm run docker:test:cypress:dev`
adrienjoly pushed a commit that referenced this pull request Mar 22, 2020
## [1.30.3](v1.30.2...v1.30.3) (2020-03-22)

### Bug Fixes

* **tests:** Reset database between each Cypress tests ([#302](#302)) ([ced6038](ced6038)), closes [#301](#301) [#199](#199)
…river-to-cypress

* master:
  fix(tests): create dummy posts from cypress tests instead of from initdb_testing (#304)
  chore(release): 1.30.3 [skip ci]
  fix(tests): Reset database between each Cypress tests (#302)

# Conflicts:
#	cypress/support/index.js
@adrienjoly adrienjoly changed the title fix(ci): migrate acceptance tests from webdriver to cypress fix(ci): Migrate acceptance tests from Webdriver to Cypress Mar 22, 2020
@adrienjoly
Copy link
Member Author

Note: although the tests are passing fine on CI, I'm getting the following error when running $ npm run docker:test:cypress:

  1) Openwhyd should allow a user to add a track:
     CypressError: Timed out retrying: cy.type() failed because this element is not visible:

<input name="q" class="q search-input" id="q" type="text" value="" placeholder="Search for a song, artist, genre, etc" autocomplete="off">

This element '<input#q.q.search-input>' is not visible because its parent '<div#header>' has CSS property: 'display: none'

@adrienjoly adrienjoly marked this pull request as ready for review March 22, 2020 19:13
@adrienjoly adrienjoly merged commit 2f6de36 into master Mar 22, 2020
Development automation moved this from ⚙ In progress to ✔️ Done / pending QA Mar 22, 2020
@adrienjoly adrienjoly deleted the fix/199-migrate-acceptance-tests-from-webdriver-to-cypress branch March 22, 2020 19:14
adrienjoly pushed a commit that referenced this pull request Mar 22, 2020
## [1.30.5](v1.30.4...v1.30.5) (2020-03-22)

### Bug Fixes

* **tests:** Migrate acceptance tests from Webdriver to Cypress ([#301](#301)) ([2f6de36](2f6de36)), closes [#199](#199)
@adrienjoly adrienjoly moved this from ✔️ Done / pending QA to 🌲 In production in Development Mar 22, 2020
adrienjoly added a commit that referenced this pull request Mar 23, 2020
* master: (64 commits)
  chore(release): 1.30.6 [skip ci]
  fix(ui): Resizing the page should not scroll to the top (#303)
  chore(release): 1.30.5 [skip ci]
  fix(tests): Migrate acceptance tests from Webdriver to Cypress (#301)
  chore(release): 1.30.4 [skip ci]
  fix(tests): create dummy posts from cypress tests instead of from initdb_testing (#304)
  chore(release): 1.30.3 [skip ci]
  fix(tests): Reset database between each Cypress tests (#302)
  chore(release): 1.30.2 [skip ci]
  fix(ui): Display correct track error message when using electron app (#294)
  chore(release): 1.30.1 [skip ci]
  fix(error): 404 redirect when clicking load more on account stream (#296)
  test(#295): add non-regression test for pagination (#299)
  chore(release): 1.30.0 [skip ci]
  feat(ci): separate ci tasks for each type of tests (#298)
  chore(release): 1.29.0 [skip ci]
  feat(ci): enable TypeScript in Cypress tests (#297)
  remove browser cache hack preventing css from displaying correct logo (#293)
  chore(release): 1.28.2 [skip ci]
  fix(ui): never-ending loading animation on empty search (#260)
  ...

# Conflicts:
#	.github/workflows/nodejs.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development
  
🌲 In production
Development

Successfully merging this pull request may close these issues.

None yet

1 participant