Skip to content

Commit ba81adb

Browse files
committed
chore: improve tests
1 parent 352e26c commit ba81adb

File tree

2 files changed

+31
-8
lines changed

2 files changed

+31
-8
lines changed

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"editor.formatOnSave": true,
23
"cucumberautocomplete.steps": [
34
"cypress/e2e/common/*.js"
45
]

cypress/e2e/common/system-designer.js

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,29 @@
1-
import { Given, When, Then, Then as And } from '@badeball/cypress-cucumber-preprocessor'
1+
/*
2+
* System Designer
3+
*
4+
* https://designfirst.io/systemdesigner/
5+
*
6+
* Copyright 2022 Erwan Carriou
7+
*
8+
* Licensed under the Apache License, Version 2.0 (the "License");
9+
* you may not use this file except in compliance with the License.
10+
* You may obtain a copy of the License at
11+
*
12+
* http://www.apache.org/licenses/LICENSE-2.0
13+
*
14+
* Unless required by applicable law or agreed to in writing, software
15+
* distributed under the License is distributed on an "AS IS" BASIS,
16+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
* See the License for the specific language governing permissions and
18+
* limitations under the License.
19+
*/
20+
21+
import {
22+
Given,
23+
When,
24+
Then,
25+
Then as And,
26+
} from '@badeball/cypress-cucumber-preprocessor'
227

328
Given('Users have opened System Designer', () => {
429
cy.visit('/').get('#designer-spaces-type').contains('Systems')
@@ -19,7 +44,6 @@ When('Users click to create a system', () => {
1944

2045
And('Users enter system name as {string}', (systemname) => {
2146
cy.get('#designer-dialog-system-creation-modal')
22-
.should('exist')
2347
.get('#designer-dialog-system-creation-name')
2448
.type(systemname)
2549
})
@@ -43,21 +67,19 @@ And('Users click to create a schema', () => {
4367
})
4468

4569
And('Users enter schema name as {string}', (schemaname) => {
46-
cy.get('#designer-dialog-schema-creation-name')
47-
.should('exist')
48-
.get('#designer-dialog-schema-creation-name')
49-
.type(schemaname)
70+
cy.get('#designer-dialog-schema-creation-name').type(schemaname)
5071
})
5172

5273
And('Users click on schema create button', () => {
5374
cy.get('#designer-dialog-schema-creation-modal-ok').click()
5475
})
5576

5677
Then('Users is able to see the schema {string}', (schemaname) => {
57-
cy.get('.panel-title').should('be.visible').contains(schemaname)
78+
cy.get('.panel-title').contains(schemaname).should('be.visible')
5879
})
5980

6081
// Component
82+
6183
When('Users click on component tab', () => {
6284
cy.get('#designer-menu-item-components').click()
6385
})
@@ -67,5 +89,5 @@ And('Users click to create a component', () => {
6789
})
6890

6991
Then('Users is able to see the component', () => {
70-
cy.get('.panel-title').should('exist')
92+
cy.get('.panel-title').should('be.visible')
7193
})

0 commit comments

Comments
 (0)