-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test run button to the test page (#649)
- Loading branch information
Showing
8 changed files
with
134 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import {createTest, deleteTest, getResultId, testId} from '../utils/common'; | ||
|
||
describe('Run Test', () => { | ||
beforeEach(() => { | ||
createTest(); | ||
}); | ||
|
||
afterEach(() => { | ||
deleteTest(); | ||
}); | ||
|
||
it('should show and click the Run Test button when the test has finished', () => { | ||
cy.visit(`http://localhost:3000/test/${testId}`); | ||
cy.get('[data-cy^=result-card]').first().click(); | ||
cy.location('href').should('match', /\/test\/.*/i); | ||
|
||
cy.get(`[data-cy^=test-run-result-]`).first().click(); | ||
cy.location('href').should('match', /\/run\/.*/i); | ||
|
||
cy.get('[data-cy=run-test-button]', {timeout: 10000}).should('be.visible'); | ||
cy.get(`[data-cy^=run-test-button]`).first().click(); | ||
|
||
cy.wait(2000); | ||
cy.location().then(({pathname}) => { | ||
const testRunResultId = getResultId(pathname); | ||
cy.location('pathname').should('eq', `/test/${testId}/run/${testRunResultId}`); | ||
}); | ||
}); | ||
}); |
22 changes: 0 additions & 22 deletions
22
web/src/components/AssertionForm/AssertionFormConfirmModal.tsx
This file was deleted.
Oops, something went wrong.
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
39 changes: 39 additions & 0 deletions
39
web/src/components/VersionMismatchModal/VersionMismatchModal.tsx
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import {Modal} from 'antd'; | ||
|
||
interface IProps { | ||
cancelText?: string; | ||
currentVersion: number; | ||
description?: string; | ||
isOpen: boolean; | ||
latestVersion: number; | ||
okText?: string; | ||
onCancel(): void; | ||
onConfirm(): void; | ||
} | ||
|
||
const VersionMismatchModal = ({ | ||
cancelText = 'Cancel', | ||
currentVersion, | ||
description, | ||
isOpen, | ||
latestVersion, | ||
okText = 'OK', | ||
onCancel, | ||
onConfirm, | ||
}: IProps) => ( | ||
<Modal | ||
cancelText={cancelText} | ||
okText={okText} | ||
onCancel={onCancel} | ||
onOk={onConfirm} | ||
title="Version Mismatch" | ||
visible={isOpen} | ||
> | ||
<p> | ||
You are viewing version {currentVersion} of this test, and the latest version is {latestVersion}. | ||
</p> | ||
<p>{description}</p> | ||
</Modal> | ||
); | ||
|
||
export default VersionMismatchModal; |
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