-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- removes global testId variable - makes createTest method return the testId - fix promises issue with cypress that was passing failed tests - start intecepting API requests - remove a couple of unnecessary wait calls
- Loading branch information
1 parent
213c3da
commit 942d184
Showing
17 changed files
with
540 additions
and
452 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,41 @@ | ||
import {createTest, deleteTest, testId} from '../utils/Common'; | ||
import {createTest, deleteTest, testRunPageRegex} from '../utils/Common'; | ||
|
||
describe('Edit Test', () => { | ||
before(() => { | ||
createTest(); | ||
}); | ||
|
||
after(() => { | ||
deleteTest(); | ||
}); | ||
|
||
beforeEach(() => { | ||
cy.visit('http://localhost:3000/'); | ||
}); | ||
|
||
it('should edit a test', () => { | ||
cy.get(`[data-cy=test-actions-button-${testId}]`).click(); | ||
cy.get('[data-cy=test-card-edit]').click(); | ||
(async () => { | ||
const testId = await createTest(); | ||
cy.visit(`http://localhost:3000`); | ||
|
||
cy.get(`[data-cy=test-actions-button-${testId}]`).click(); | ||
cy.get('[data-cy=test-card-edit]').click(); | ||
|
||
cy.get('[data-cy=edit-test-form]').should('be.visible'); | ||
cy.get('[data-cy=create-test-name-input] input').clear().type('Edited Test'); | ||
cy.get('[data-cy=edit-test-form]').should('be.visible'); | ||
cy.get('[data-cy=create-test-name-input] input').clear().type('Edited Test'); | ||
|
||
cy.get('[data-cy=edit-test-submit]').click(); | ||
cy.get('[data-cy=test-details-name]').should('have.text', `Edited Test (v2)`); | ||
cy.get('[data-cy=edit-test-submit]').click(); | ||
cy.get('[data-cy=test-details-name]').should('have.text', `Edited Test (v2)`); | ||
|
||
cy.location('pathname').should('match', /\/test\/.*/i, {timeout: 10000}); | ||
cy.location('pathname').should('match', testRunPageRegex, {timeout: 20000}); | ||
deleteTest(testId); | ||
})(); | ||
}); | ||
|
||
it('should edit a test from the test details', () => { | ||
cy.visit(`http://localhost:3000/test/${testId}`); | ||
(async () => { | ||
const testId = await createTest(); | ||
cy.visit(`http://localhost:3000/test/${testId}`); | ||
|
||
cy.get(`[data-cy=test-actions-button-${testId}]`).click(); | ||
cy.get('[data-cy=test-card-edit]').click(); | ||
cy.get(`[data-cy=test-actions-button-${testId}]`).click(); | ||
cy.get('[data-cy=test-card-edit]').click(); | ||
|
||
cy.get('[data-cy=edit-test-form]').should('be.visible'); | ||
cy.get('[data-cy=create-test-name-input] input').clear().type('Edited Test'); | ||
cy.get('[data-cy=edit-test-form]').should('be.visible'); | ||
cy.get('[data-cy=create-test-name-input] input').clear().type('Edited Test'); | ||
|
||
cy.get('[data-cy=edit-test-submit]').click(); | ||
cy.get('[data-cy=test-details-name]').should('have.text', `Edited Test (v2)`); | ||
cy.get('[data-cy=edit-test-submit]').click(); | ||
cy.get('[data-cy=test-details-name]').should('have.text', `Edited Test (v2)`); | ||
|
||
cy.location('pathname').should('match', /\/run\/.*/i, {timeout: 10000}); | ||
cy.location('pathname').should('match', /\/run\/.*/i, {timeout: 10000}); | ||
deleteTest(testId); | ||
})(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.