+++ /dev/null
-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;
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;
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;
.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');
}
};
+++ /dev/null
-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');
- }
-};
.click('@authorityTypeInput')
.click('@subjectAuthorityType')
.click('@searchResult')
- .click('#edit');
+ .click('@editTab');
const marcEdit = browser.page.marcEdit();
marcEdit.waitForElementVisible('@marcTag450', 15_000)
.setValue('@marcTag450', '550')
const vandelay = browser.page.vandelay();
navigateToMarcBatchImport(vandelay);
vandelay.click('@recordDisplayAttributes')
- .click('#authority')
+ .click('@authorityAttributesTab')
.click('@newVqradButton')
.setValue('@codeInput', 'lccn')
.setValue('@descriptionInput', 'LC control number')