Commit 756e5824 authored by Thonier Florian's avatar Thonier Florian
Browse files

cypress, allow to set a timeout to openAnalysis call

parent a41d6c7d
Pipeline #353044 failed with stages
in 61 minutes and 1 second
......@@ -51,7 +51,7 @@ Cypress.Commands.add('open_menu_import', () => {
Cypress.Commands.add("openAnalysis", (file_vidjil, file_analysis) => {
Cypress.Commands.add("openAnalysis", (file_vidjil, file_analysis, timeout) => {
cy.open_menu_import()
cy.get('#import_data_anchor').click()
cy.log(`file_vidjil: ${file_vidjil}`)
......@@ -68,13 +68,13 @@ Cypress.Commands.add("openAnalysis", (file_vidjil, file_analysis) => {
cy.get("button[id=start_import_json]")
.click();
// Wait the end of the loading (async)
cy.update_icon()
cy.update_icon(timeout)
})
/**
* Allow to wait for update icon to be not visible
*/
Cypress.Commands.add("update_icon", (delay=0) => {
Cypress.Commands.add("update_icon", (delay=0, timeout=undefined) => {
let visible_icon = false;
cy.get('#updateIcon')
.then( ($icon) => {
......@@ -87,8 +87,8 @@ Cypress.Commands.add("update_icon", (delay=0) => {
}
}
)
cy.get('#updateIcon', { timeout: 6000 })
timeout = (timeout!=undefined) ? timeout : 6000
cy.get('#updateIcon', { timeout: timeout })
.should("not.visible")
})
......
......@@ -16,7 +16,7 @@ describe('Creation of users and groups', function () {
cy.closeDBPage()
cy.openAnalysis("doc/demo_lil_l3_tutorial.vidjil", "doc/demo_lil_l3_tutorial.analysis")
cy.openAnalysis("doc/demo_lil_l3_tutorial.vidjil", "doc/demo_lil_l3_tutorial.analysis", 25000)
cy.screenshot('starting_state')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment