diff --git a/cypress/integration/elife/manuscripts_page_spec.js b/cypress/integration/elife/manuscripts_page_spec.js index 694de1e2f65012044f46c0a89f5469dd41339de5..381739659df68193b47ec490fe13af170b230557 100644 --- a/cypress/integration/elife/manuscripts_page_spec.js +++ b/cypress/integration/elife/manuscripts_page_spec.js @@ -93,15 +93,15 @@ describe('Manuscripts page tests', () => { NewSubmissionPage.clickSubmitURL() SubmissionFormPage.fillInArticleld('def') Menu.clickManuscripts() - ManuscriptsPage.getArticleIdByRow(0).should('contain', 'def') - ManuscriptsPage.getArticleIdByRow(1).should('contain', 'abc') - ManuscriptsPage.getArticleIdByRow(2).should('contain', '456') - ManuscriptsPage.getArticleIdByRow(3).should('contain', '123') + ManuscriptsPage.getArticleTitleByRow(0).should('contain', 'def') + ManuscriptsPage.getArticleTitleByRow(1).should('contain', 'abc') + ManuscriptsPage.getArticleTitleByRow(2).should('contain', '456') + ManuscriptsPage.getArticleTitleByRow(3).should('contain', '123') ManuscriptsPage.clickTableHead(0) - ManuscriptsPage.getArticleIdByRow(0).should('contain', '123') - ManuscriptsPage.getArticleIdByRow(1).should('contain', '456') - ManuscriptsPage.getArticleIdByRow(2).should('contain', 'abc') - ManuscriptsPage.getArticleIdByRow(3).should('contain', 'def') + ManuscriptsPage.getArticleTitleByRow(0).should('contain', '123') + ManuscriptsPage.getArticleTitleByRow(1).should('contain', '456') + ManuscriptsPage.getArticleTitleByRow(2).should('contain', 'abc') + ManuscriptsPage.getArticleTitleByRow(3).should('contain', 'def') }) }) @@ -218,7 +218,7 @@ describe('Manuscripts page tests', () => { ManuscriptsPage.getTableHead(0).should('contain', 'Article Id') // eslint-disable-next-line jest/valid-expect-in-promise cy.fixture('submission_form_data').then(data => { - ManuscriptsPage.getArticleIdByRow(0).should('contain', data.articleId) + ManuscriptsPage.getArticleTitleByRow(0).should('contain', data.articleId) }) }) }) diff --git a/cypress/integration/ncrc/manuscripts_page_spec.js b/cypress/integration/ncrc/manuscripts_page_spec.js index b2155bdd1ec38ebe07036adc1d725645e7cfde14..0f348d731937a07e4222731e586b2e2ce539ba50 100644 --- a/cypress/integration/ncrc/manuscripts_page_spec.js +++ b/cypress/integration/ncrc/manuscripts_page_spec.js @@ -172,12 +172,13 @@ describe('manuscripts page tests', () => { }) }) }) - context('filter by topics and sort by label', () => { + context('filter and sort articles', () => { beforeEach(() => { ManuscriptsPage.clickSubmit() NewSubmissionPage.clickSubmitURL() // eslint-disable-next-line jest/valid-expect-in-promise cy.fixture('form_option').then(data => { + SubmissionFormPage.fillInArticleDescription('123') SubmissionFormPage.clickElementFromFormOptionList(9) SubmissionFormPage.selectDropdownOption(0) SubmissionFormPage.clickTopicsCheckboxWithText( @@ -186,6 +187,7 @@ describe('manuscripts page tests', () => { Menu.clickManuscripts() ManuscriptsPage.clickSubmit() NewSubmissionPage.clickSubmitURL() + SubmissionFormPage.fillInArticleDescription('abc') SubmissionFormPage.clickElementFromFormOptionList(9) SubmissionFormPage.selectDropdownOption(1) SubmissionFormPage.clickTopicsCheckboxWithText( @@ -197,6 +199,7 @@ describe('manuscripts page tests', () => { Menu.clickManuscripts() ManuscriptsPage.clickSubmit() NewSubmissionPage.clickSubmitURL() + SubmissionFormPage.fillInArticleDescription('def') SubmissionFormPage.clickElementFromFormOptionList(9) SubmissionFormPage.selectDropdownOption(0) SubmissionFormPage.clickTopicsCheckboxWithText( @@ -239,5 +242,15 @@ describe('manuscripts page tests', () => { ManuscriptsPage.getLabelRow(1).should('contain', 'ready to evaluat') ManuscriptsPage.getLabelRow(2).should('contain', 'ready to evaluat') }) + it('sort article by Description', () => { + ManuscriptsPage.getTableHead(0).should('contain', 'Description') + ManuscriptsPage.getArticleTitleByRow(0).should('contain', 'def') + ManuscriptsPage.getArticleTitleByRow(1).should('contain', 'abc') + ManuscriptsPage.getArticleTitleByRow(2).should('contain', '123') + ManuscriptsPage.clickTableHead(0) + ManuscriptsPage.getArticleTitleByRow(0).should('contain', '123') + ManuscriptsPage.getArticleTitleByRow(1).should('contain', 'abc') + ManuscriptsPage.getArticleTitleByRow(2).should('contain', 'def') + }) }) }) diff --git a/cypress/page-object/manuscripts-page.js b/cypress/page-object/manuscripts-page.js index 50f1de6cdf04bfd1c33c9fb60991fee50778bc5a..5532db84321d02b1bc4c0e5eb32db5ad1b99c3bd 100644 --- a/cypress/page-object/manuscripts-page.js +++ b/cypress/page-object/manuscripts-page.js @@ -13,7 +13,7 @@ const CREATED_CARET = 'Carets__Caret' const AUTHOR_FIELD = 'UserCombo__Primary' const STATUS_FIELD = 'Badge__Status' const MANUSCRIPTS_TABLE_HEAD = '[class*=Table__Header] > tr >th' -const ARTICLE_ID = '[class*=Table__Row]>td:nth-child(1)' +const ARTICLE_TITLE = '[class*=Table__Row]>td:nth-child(1)' const ARTICLE_LABEL = 'style__StyledTableLabel' const ARTICLE_TOPIC = '[class*=Table__Cell] > [title]' const TABLE_ROW = 'Table__Row' @@ -65,8 +65,8 @@ export const ManuscriptsPage = { getTableHead(nth) { return cy.get(MANUSCRIPTS_TABLE_HEAD).eq(nth) }, - getArticleIdByRow(nth) { - return cy.get(ARTICLE_ID).eq(nth) + getArticleTitleByRow(nth) { + return cy.get(ARTICLE_TITLE).eq(nth) }, clickTableHead(nth) { this.getTableHead(nth).click()