From 8643d9c255b8fd98b8b072c50276eb003bcd740d Mon Sep 17 00:00:00 2001
From: Ema Suarasan <beatrice.suarasan@endava.com>
Date: Wed, 7 Apr 2021 13:13:09 +0300
Subject: [PATCH] test: add timeout before form submission

---
 .../elife/manuscripts_page_spec.js            |  2 ++
 .../integration/ncrc/manuscripts_page_spec.js | 30 ++++++++++++++-----
 2 files changed, 25 insertions(+), 7 deletions(-)

diff --git a/cypress/integration/elife/manuscripts_page_spec.js b/cypress/integration/elife/manuscripts_page_spec.js
index 50d7997a5f..694de1e2f6 100644
--- a/cypress/integration/elife/manuscripts_page_spec.js
+++ b/cypress/integration/elife/manuscripts_page_spec.js
@@ -189,6 +189,8 @@ describe('Manuscripts page tests', () => {
         SubmissionFormPage.clickElementFromFormOptionList(4)
         SubmissionFormPage.selectDropdownOption(-1)
         SubmissionFormPage.fillInCreator('creator')
+        // eslint-disable-next-line
+        cy.wait(2000)
         SubmissionFormPage.clickSubmitResearch()
         ManuscriptsPage.clickEvaluation()
         // eslint-disable-next-line
diff --git a/cypress/integration/ncrc/manuscripts_page_spec.js b/cypress/integration/ncrc/manuscripts_page_spec.js
index 052b53c0a1..b2155bdd1e 100644
--- a/cypress/integration/ncrc/manuscripts_page_spec.js
+++ b/cypress/integration/ncrc/manuscripts_page_spec.js
@@ -121,6 +121,8 @@ describe('manuscripts page tests', () => {
         SubmissionFormPage.clickDropdown(-1)
         SubmissionFormPage.selectDropdownOption(0)
         SubmissionFormPage.clickTopicsCheckboxWithText(data.topic)
+        // eslint-disable-next-line
+        cy.wait(2000)
         SubmissionFormPage.clickSubmitManuscript()
       })
     })
@@ -157,7 +159,8 @@ describe('manuscripts page tests', () => {
         ManuscriptsPage.getStatus(0).should('eq', 'Submitted')
         ManuscriptsPage.clickEvaluation(0)
         SubmissionFormPage.fillInValueAdded('Evaluated')
-        SubmissionFormPage.clickTopicsCheckboxWithText('vaccines')
+        // eslint-disable-next-line
+        cy.wait(2500)
         SubmissionFormPage.clickSubmitManuscript()
         ManuscriptsPage.clickEvaluation()
         // eslint-disable-next-line
@@ -177,21 +180,31 @@ describe('manuscripts page tests', () => {
       cy.fixture('form_option').then(data => {
         SubmissionFormPage.clickElementFromFormOptionList(9)
         SubmissionFormPage.selectDropdownOption(0)
-        SubmissionFormPage.clickTopicsCheckboxWithText(data.ncrc.topicTypes.vaccines)
+        SubmissionFormPage.clickTopicsCheckboxWithText(
+          data.ncrc.topicTypes.vaccines,
+        )
         Menu.clickManuscripts()
         ManuscriptsPage.clickSubmit()
         NewSubmissionPage.clickSubmitURL()
         SubmissionFormPage.clickElementFromFormOptionList(9)
         SubmissionFormPage.selectDropdownOption(1)
-        SubmissionFormPage.clickTopicsCheckboxWithText(data.ncrc.topicTypes.ecologyAndSpillover)
-        SubmissionFormPage.clickTopicsCheckboxWithText(data.ncrc.topicTypes.diagnostics)
+        SubmissionFormPage.clickTopicsCheckboxWithText(
+          data.ncrc.topicTypes.ecologyAndSpillover,
+        )
+        SubmissionFormPage.clickTopicsCheckboxWithText(
+          data.ncrc.topicTypes.diagnostics,
+        )
         Menu.clickManuscripts()
         ManuscriptsPage.clickSubmit()
         NewSubmissionPage.clickSubmitURL()
         SubmissionFormPage.clickElementFromFormOptionList(9)
         SubmissionFormPage.selectDropdownOption(0)
-        SubmissionFormPage.clickTopicsCheckboxWithText(data.ncrc.topicTypes.modeling)
-        SubmissionFormPage.clickTopicsCheckboxWithText(data.ncrc.topicTypes.diagnostics)
+        SubmissionFormPage.clickTopicsCheckboxWithText(
+          data.ncrc.topicTypes.modeling,
+        )
+        SubmissionFormPage.clickTopicsCheckboxWithText(
+          data.ncrc.topicTypes.diagnostics,
+        )
         Menu.clickManuscripts()
       })
     })
@@ -206,7 +219,10 @@ describe('manuscripts page tests', () => {
       cy.url().should('contain', 'diagnostics')
       ManuscriptsPage.getArticleTopic(0).should('contain', 'modeling')
       ManuscriptsPage.getArticleTopic(1).should('contain', 'diagnostics')
-      ManuscriptsPage.getArticleTopic(2).should('contain', 'ecology and spillover')
+      ManuscriptsPage.getArticleTopic(2).should(
+        'contain',
+        'ecology and spillover',
+      )
       ManuscriptsPage.getArticleTopic(3).should('contain', 'diagnostics')
       Menu.clickManuscripts()
       ManuscriptsPage.clickArticleTopic(0)
-- 
GitLab