Describe the bug
The cypress tests for the repo page depend on data that is created and abandoned by the mocha tests. I.e. the test-repo used here:
|
const cloneURL = 'http://localhost:8000/finos/test-repo.git'; |
|
const tooltipQuery = 'div[role="tooltip"]'; |
|
|
|
cy |
|
// tooltip isn't open to start with |
|
.get(tooltipQuery) |
|
.should('not.exist'); |
|
|
|
cy |
|
// find the entry for finos/test-repo |
|
.get('a[href="https://github.com/admin/repo/test-repo"]') |
The data is created in a mocha test here:
|
const res = await chai.request(app).post('/api/v1/repo').set('Cookie', `${cookie}`).send({ |
|
project: 'finos', |
|
name: 'test-repo', |
|
url: 'https://github.com/finos/test-repo.git', |
|
}); |
|
res.should.have.status(200); |
Which also has to handle it (perhaps) already existing on run:
|
// Prepare the data. |
|
await db.deleteRepo('test-repo'); |
|
await db.deleteUser('u1'); |
|
await db.deleteUser('u2'); |
Ideally tests should handle their own set-up and tear-down (clean-up). As the cypress tests use client-side JS they can't directly import the DB clients and create the data they need, but they could make API calls or a node script be used for setup and tear down before/after the cypress command.
Expected behaviour
Each set of tests handles its own data creation and subsequent clean-up.
Additional context
Add any other context about the problem here.
Describe the bug
The cypress tests for the repo page depend on data that is created and abandoned by the mocha tests. I.e. the
test-repoused here:git-proxy/cypress/e2e/repo.cy.js
Lines 11 to 21 in 3718943
The data is created in a mocha test here:
git-proxy/test/addRepoTest.test.js
Lines 44 to 49 in 3718943
Which also has to handle it (perhaps) already existing on run:
git-proxy/test/addRepoTest.test.js
Lines 26 to 29 in 3718943
Ideally tests should handle their own set-up and tear-down (clean-up). As the cypress tests use client-side JS they can't directly import the DB clients and create the data they need, but they could make API calls or a node script be used for setup and tear down before/after the cypress command.
Expected behaviour
Each set of tests handles its own data creation and subsequent clean-up.
Additional context
Add any other context about the problem here.