From: Jane Sandberg Date: Wed, 22 Feb 2023 15:17:13 +0000 (-0800) Subject: LP1989195: Update nightwatch selectors X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=4ee70869b906916f6a29dce5c5fbd25b7f70bbd9;p=evergreen%2Fjoelewis.git LP1989195: Update nightwatch selectors Also, remove flakey test for now Signed-off-by: Jane Sandberg Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/eg2/nightwatch/pages/staff/admin/orgUnitAdmin.ts b/Open-ILS/src/eg2/nightwatch/pages/staff/admin/orgUnitAdmin.ts deleted file mode 100644 index 64acac01df..0000000000 --- a/Open-ILS/src/eg2/nightwatch/pages/staff/admin/orgUnitAdmin.ts +++ /dev/null @@ -1,20 +0,0 @@ -import {PageObjectModel} from 'nightwatch'; - -const orgUnitAdmin: PageObjectModel = { - elements: { - system2expand: { - selector: '//div[@class = "eg-tree"]/div[./div/a[text()="Example System 2 -- SYS2"]]/div[@class="eg-tree-node-expandy"]/div/span[text()="expand_more"]', - locateStrategy: 'xpath' - }, - br3: { - selector: '//a[text()="Example Branch 3 -- BR3"]', - locateStrategy: 'xpath' - }, - saveButton: { - selector: '//button[text()="Save"]', - locateStrategy: 'xpath' - } - } -}; - -export default orgUnitAdmin; diff --git a/Open-ILS/src/eg2/nightwatch/pages/staff/cat/authority.ts b/Open-ILS/src/eg2/nightwatch/pages/staff/cat/authority.ts index 028deed809..27c9e6a832 100644 --- a/Open-ILS/src/eg2/nightwatch/pages/staff/cat/authority.ts +++ b/Open-ILS/src/eg2/nightwatch/pages/staff/cat/authority.ts @@ -16,8 +16,12 @@ const authority: PageObjectModel = { searchResult: { selector: '//a[contains(text(), "Philosophy, Chinese")]', locateStrategy: 'xpath' + }, + editTab: { + selector: '//a[text()="Edit" and contains(@class, "nav-link")]', + locateStrategy: 'xpath' } } }; -export default authority; \ No newline at end of file +export default authority; diff --git a/Open-ILS/src/eg2/nightwatch/pages/staff/cat/vandelay.ts b/Open-ILS/src/eg2/nightwatch/pages/staff/cat/vandelay.ts index 37b7880119..82595a2967 100644 --- a/Open-ILS/src/eg2/nightwatch/pages/staff/cat/vandelay.ts +++ b/Open-ILS/src/eg2/nightwatch/pages/staff/cat/vandelay.ts @@ -41,8 +41,12 @@ const vandelay: PageObjectModel = { authorityRecordType: { selector: '//button/span[text()="Authority Records"]', locateStrategy: 'xpath' + }, + authorityAttributesTab: { + selector: '//a[text()="Authority Attributes" and contains(@class, "nav-link")]', + locateStrategy: 'xpath' } } }; -export default vandelay; \ No newline at end of file +export default vandelay; diff --git a/Open-ILS/src/eg2/nightwatch/src/staff/acq/provider.spec.ts b/Open-ILS/src/eg2/nightwatch/src/staff/acq/provider.spec.ts index e80a31e854..393595dd01 100644 --- a/Open-ILS/src/eg2/nightwatch/src/staff/acq/provider.spec.ts +++ b/Open-ILS/src/eg2/nightwatch/src/staff/acq/provider.spec.ts @@ -16,21 +16,19 @@ module.exports = { .assert.textContains('div.lead.alert', 'Providers'); }, 'Can navigate via tabs': (browser: NightwatchBrowser) => { - const tabIds = ['purchase_orders', 'invoices', 'details']; navigateToEgUrl('eg2/en-US/staff/acq/provider/4/details', browser); - for (const tabId of tabIds) { - const selector = '#' + tabId; - browser.click(selector) - .waitForElementVisible(selector + '-panel') - .assert.hasClass(selector, 'active') - .assert.attributeEquals(selector, 'aria-selected', 'true'); - } + browser.click('link text', 'POs') + .assert.textContains('.tab-content', 'Purchase Order ID'); + browser.click('link text', 'Invoices') + .assert.textContains('.tab-content', 'Invoice Type'); + browser.click('link text', 'Provider') + .assert.textContains('.tab-content', 'SAN'); }, 'Warning displayed when moving to a different tab, but holdings tab has unsaved changes': (browser: NightwatchBrowser) => { navigateToEgUrl('eg2/en-US/staff/acq/provider/4/holdings', browser); browser.setValue('#holdings-tag', '981') - .click('#details') + .click('link text', 'Provider') .assert.textMatches('h4.modal-title', 'Unsaved Changes Warning'); } }; diff --git a/Open-ILS/src/eg2/nightwatch/src/staff/admin/org_unit.spec.ts b/Open-ILS/src/eg2/nightwatch/src/staff/admin/org_unit.spec.ts deleted file mode 100644 index 6cfc3308b7..0000000000 --- a/Open-ILS/src/eg2/nightwatch/src/staff/admin/org_unit.spec.ts +++ /dev/null @@ -1,31 +0,0 @@ -import {NightwatchBrowser} from 'nightwatch'; -import {navigateToEgUrl, fmEditorFieldSelector} from '../../utils'; - -module.exports = { - before: (browser: NightwatchBrowser) => { - // System administrator housed at BR3 - browser.page.login().loginToWebClient(browser, 'br3cmartin', 'carlm1234'); - }, - - after: (browser: NightwatchBrowser) => { - browser.end(); - }, - - 'Can edit an org unit address': (browser: NightwatchBrowser) => { - navigateToEgUrl('/eg2/en-US/staff/admin/server/actor/org_unit', browser); - const orgUnitAdmin = browser.page.orgUnitAdmin(); - // Sometimes this part of the org tree is already expanded, sometimes not... - orgUnitAdmin.api.element('@system2expand', (result) => { - if (result.status != -1) { - orgUnitAdmin.click('@system2expand'); - } - }); - orgUnitAdmin.click('@br3') - .click('#addresses') - .click('#ill_address') - .setValue(fmEditorFieldSelector('Street1'), 'Apartment 221B') - .click('@saveButton') - .assert.visible('#eg-toast-container') - .assert.containsText('#eg-toast-container', 'Update Succeeded'); - } -}; diff --git a/Open-ILS/src/eg2/nightwatch/src/staff/cat/authority.spec.ts b/Open-ILS/src/eg2/nightwatch/src/staff/cat/authority.spec.ts index 16c7b1de14..caca4cf129 100644 --- a/Open-ILS/src/eg2/nightwatch/src/staff/cat/authority.spec.ts +++ b/Open-ILS/src/eg2/nightwatch/src/staff/cat/authority.spec.ts @@ -17,7 +17,7 @@ module.exports = { .click('@authorityTypeInput') .click('@subjectAuthorityType') .click('@searchResult') - .click('#edit'); + .click('@editTab'); const marcEdit = browser.page.marcEdit(); marcEdit.waitForElementVisible('@marcTag450', 15_000) .setValue('@marcTag450', '550') diff --git a/Open-ILS/src/eg2/nightwatch/src/staff/cat/vandelay.spec.ts b/Open-ILS/src/eg2/nightwatch/src/staff/cat/vandelay.spec.ts index c7cf07cd40..bc11df4b93 100644 --- a/Open-ILS/src/eg2/nightwatch/src/staff/cat/vandelay.spec.ts +++ b/Open-ILS/src/eg2/nightwatch/src/staff/cat/vandelay.spec.ts @@ -24,7 +24,7 @@ module.exports = { const vandelay = browser.page.vandelay(); navigateToMarcBatchImport(vandelay); vandelay.click('@recordDisplayAttributes') - .click('#authority') + .click('@authorityAttributesTab') .click('@newVqradButton') .setValue('@codeInput', 'lccn') .setValue('@descriptionInput', 'LC control number')