Skip to content

Commit f89181c

Browse files
committed
PROCESS: Tests should wait on creating documents from scratch.
1 parent 1bb9499 commit f89181c

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

frontend/tests/support.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,28 @@ Cypress.Commands.add('click_on_text', (type, text) => {
3232
cy.wait('@getDocument');
3333
});
3434

35-
Cypress.Commands.add('create_glose', (random = false) => {
35+
Cypress.Commands.add('click_on_create', () => {
3636
cy.get('.create-document').click();
3737
cy.url().should('match', /\/[0-9a-f]+\/[0-9a-f]+$/);
38+
});
39+
40+
Cypress.Commands.add('create_glose', (random = false) => {
41+
cy.click_on_create();
3842
if (random) {
3943
cy.set_random_name();
4044
}
4145
});
4246

4347
Cypress.Commands.add('create_glose_of_type', (random = false, option = "Adaptation") => {
4448
cy.get('#select-dropdown').select(option);
45-
cy.get('.create-document').click();
46-
cy.url().should('match', /\/[0-9a-f]+\/[0-9a-f]+$/);
49+
cy.click_on_create();
4750
if (random) {
4851
cy.set_random_name();
4952
}
5053
});
5154

5255
Cypress.Commands.add('create_document_from_scratch', () => {
53-
cy.get('.create-document').click();
56+
cy.click_on_create();
5457
cy.get('.lectern').should('exist');
5558
});
5659

0 commit comments

Comments
 (0)