-
Notifications
You must be signed in to change notification settings - Fork 67
/
TestSuite.spec.ts
41 lines (33 loc) 路 1.29 KB
/
TestSuite.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import TestSuite from '../utils/TestSuites';
const testSuiteUtils = TestSuite();
describe('TestSuites', () => {
beforeEach(() => {
cy.visit('/testsuites');
cy.wrap(testSuiteUtils.createTests());
});
afterEach(() => {
cy.wrap(testSuiteUtils.deleteTests()).then(() => {
cy.deleteTestSuite();
});
});
it('should create a TestSuite with multiple tests', () => {
const name = `TestSuite - #${String(Date.now()).slice(-4)}`;
cy.openTestSuiteCreationModal();
cy.interceptHomeApiCall();
cy.fillCreateFormBasicStep(name, name, 'CreateTestSuiteFactory');
testSuiteUtils.testList.forEach(test => {
cy.get('[data-cy=testsuite-test-selection]').click();
cy.get(`[data-cy="${test.spec.name}"]`).first().click();
});
cy.submitCreateForm('CreateTestSuiteFactory');
cy.get('[data-cy=testsuite-details-name').should('have.text', `${name} (v1)`);
});
it('should create a TestSuite with no tests', () => {
const name = `TestSuite - #${String(Date.now()).slice(-4)}`;
cy.openTestSuiteCreationModal();
cy.interceptHomeApiCall();
cy.fillCreateFormBasicStep(name, name, 'CreateTestSuiteFactory');
cy.submitCreateForm('CreateTestSuiteFactory');
cy.get('[data-cy=testsuite-details-name').should('have.text', `${name} (v1)`);
});
});