Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Commit

Permalink
Upgrade to terra-functional-testing and Node 12 (#225)
Browse files Browse the repository at this point in the history
* Upgrade to terra-functional-testing and Node 12

* Fix getAlertText in application-base test.

* Update package.json

Co-authored-by: Matt Henkes <[email protected]>

* Update package.json

Co-authored-by: Matt Henkes <[email protected]>
  • Loading branch information
benbcai and mjhenkes authored Jun 7, 2021
1 parent 3a0a88d commit b003f97
Show file tree
Hide file tree
Showing 298 changed files with 197 additions and 202 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/dubnium
lts/erbium
12 changes: 8 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ branches:
cache:
directories:
- travis-build
- docker_images
before_install:
# Clean install on any new build
- npm run clean
before_script:
# Load Docker Cache
- docker load -i docker_images/images.tar || true
jobs:
include:
- stage: lint jest and compile
Expand All @@ -23,6 +27,10 @@ jobs:
- npm run compile:prod -- --env.disableAggregateThemes --output-path $TRAVIS_BUILD_DIR/travis-build/default
- npm run compile:lowlight -- --output-path $TRAVIS_BUILD_DIR/travis-build/lowlight
- npm run compile:fusion -- --output-path $TRAVIS_BUILD_DIR/travis-build/fusion
# Prime the docker cache
- docker-compose --file ./node_modules/@cerner/terra-functional-testing/lib/docker/docker-compose.yml pull
# Save docker cache
- docker save -o docker_images/images.tar $(docker images -a -q)
# Split out all the wdio runs to not eat up all the travis executors at once.

- stage: wdio
Expand All @@ -32,21 +40,17 @@ jobs:
# Rely on the cache for node_modules.. this won't work for any node modules in the packages dir but works for running wdio
install: skip
script:
# we start up our own standalone chrome instance because the Selenium Docker Service doesn't seem to work here.
- docker-compose up -d standalone-chrome-travis
# using the travis env section to set env variables seems to break cache
- SITE=$TRAVIS_BUILD_DIR/travis-build/default npm run wdio-default
- name: lowlight-theme
before_install: skip
install: skip
script:
- docker-compose up -d standalone-chrome-travis
- SITE=$TRAVIS_BUILD_DIR/travis-build/lowlight npm run wdio-lowlight
- name: fusion-theme
before_install: skip
install: skip
script:
- docker-compose up -d standalone-chrome-travis
- SITE=$TRAVIS_BUILD_DIR/travis-build/fusion npm run wdio-fusion

- stage: deploy
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## Unreleased

* Changed
* Removed terra-toolkit as a dependency
* Upgraded to WebDriverIO v6 and terra-functional-testing
* Upgraded to @cerner/webpack-config-terra

## 1.47.1 - (April 27, 2021)

* Fixed
Expand Down
14 changes: 6 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "1.47.1",
"description": "A framework to support application development with Terra components",
"engines": {
"node": ">=8.9.2 <11"
"node": ">=10 <15"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -90,9 +90,9 @@
"start-heroku": "terra express-server --port $PORT --site ./build",
"start-static": "npm run pack && terra express-server --site ./build",
"test": "npm run lint && npm run jest && npm run wdio",
"wdio-default": "wdio",
"wdio-lowlight": "THEME=clinical-lowlight-theme wdio",
"wdio-fusion": "THEME=orion-fusion-theme wdio",
"wdio-default": "terra wdio",
"wdio-lowlight": "terra wdio --themes clinical-lowlight-theme",
"wdio-fusion": "terra wdio --themes orion-fusion-theme",
"wdio": "npm run wdio-default && npm run wdio-lowlight && npm run wdio-fusion"
},
"dependencies": {
Expand Down Expand Up @@ -147,8 +147,9 @@
"@babel/preset-react": "^7.9.1",
"@cerner/browserslist-config-terra": "^3.1.0",
"@cerner/eslint-config-terra": "^4.0.0",
"@cerner/webpack-config-terra": "^1.3.1",
"@cerner/terra-aggregate-translations": "^2.0.1",
"@cerner/terra-functional-testing": "^1.7.0",
"@cerner/webpack-config-terra": "^1.3.1",
"@testing-library/react": "^10.0.4",
"@testing-library/jest-dom": "^5.11.6",
"@testing-library/user-event": "^12.6.0",
Expand All @@ -164,9 +165,7 @@
"gh-pages": "^2.2.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^24.8.0",
"pacote": "^11.1.11",
"postcss": "^8.2.1",
"raf": "^3.4.1",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-intl": "^2.9.0",
Expand All @@ -176,7 +175,6 @@
"terra-collapsible-menu-view": "^6.29.0",
"terra-dev-site": "^6.15.0",
"terra-enzyme-intl": "^3.3.0",
"terra-toolkit": "^6.0.0",
"webpack-merge": "^5.7.3",
"webpack": "^4.42.0",
"webpack-cli": "^3.3.11",
Expand Down
4 changes: 2 additions & 2 deletions src/terra-dev-site/app/components.2/NotificationBanner.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ The Notification Banner has the following data attribute available for browser t
```js
describe('Notification Banner', () => {
it('renders a notification banner', () => {
browser.click('#triggerErrorNotificationBanner');
browser.waitForExist('[data-terra-application-notification-banner="error]');
$('#triggerErrorNotificationBanner').click();
$('[data-terra-application-notification-banner="error]').waitForExist();
Terra.validates.element('shows error banner', { selector: '#root' });
});
});
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 9 additions & 11 deletions tests/wdio/application-base/application-base-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Terra.describeViewports('ApplicationBase', ['small', 'large'], () => {
it('should render the application loading overlay', () => {
browser.url('/raw/tests/terra-application/application-base/application-base-test');

browser.click('button#overlay');
$('button#overlay').click();
browser.disableCSSAnimations();

Terra.validates.element('loading overlay', { selector: '#root' });
Expand All @@ -17,15 +17,15 @@ Terra.describeViewports('ApplicationBase', ['small', 'large'], () => {
it('should render the application status overlay', () => {
browser.url('/raw/tests/terra-application/application-base/application-base-test');

browser.click('button#statusView');
$('button#statusView').click();

Terra.validates.element('status overlay', { selector: '#root' });
});

it('should render the application error boundary', () => {
browser.url('/raw/tests/terra-application/application-base/application-base-test');

browser.click('button#error');
$('button#error').click();

Terra.validates.element('error boundary', { selector: '#root' });
});
Expand All @@ -35,7 +35,7 @@ Terra.describeViewports('ApplicationBase', ['small', 'large'], () => {
try {
// alertText will throw an exception if no alert is presented.
browser.pause(1000);
browser.alertText();
browser.getAlertText();
return true;
} catch (e) {
return false;
Expand All @@ -47,18 +47,16 @@ Terra.describeViewports('ApplicationBase', ['small', 'large'], () => {
});

it('presents prompt on unload', () => {
browser.click('button#prompt');
$('button#prompt').click();
browser.execute('location.reload(true);');

expect(hasAlert()).to.equal(true);
expect(hasAlert()).toEqual(true);
});

it('does not present prompt on unload if no navigation prompts present', () => {
browser.alertDismiss();
browser.click('button#prompt');
browser.dismissAlert();
$('button#prompt').click();
browser.execute('location.reload(true);');

expect(hasAlert()).to.equal(false);
expect(hasAlert()).toEqual(false);
});
});
});
2 changes: 1 addition & 1 deletion tests/wdio/application-base/private/test-overrides-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ Terra.describeViewports('TestOverrides', ['small'], () => {
before(() => browser.url('/raw/tests/terra-application/application-base/private/test-overrides-test'));
it('updates the locale of ApplicationBase from `en` to `pt` via custom event', () => {
dispatchCustomEvent('applicationBase.testOverride', { locale: 'pt' });
Terra.validates.element({ selector: '#root' });
Terra.validates.element('test overrides', { selector: '#root' });
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ Terra.describeViewports('ApplicationErrorBoundary', ['large'], () => {
it('should render the application error boundary', () => {
browser.url('/raw/tests/terra-application/application-error-boundary/error-boundary-test');

browser.moveToObject('#root', 0, 0);
$('#root').moveTo({ xOffset: 0, yOffset: 0 });

Terra.validates.element('initial', { selector: '#root' });

browser.click('button');
$('button').click();

Terra.validates.element('error boundary', { selector: '#root' });
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@ Terra.describeViewports('ApplicationLoadingOverlay', ['large'], () => {
before(() => {
browser.url('/raw/tests/terra-application/application-loading-overlay/loading-overlay-test');
browser.disableCSSAnimations();
browser.moveToObject('#root', 0, 0);
$('#root').moveTo({ xOffset: 0, yOffset: 0 });
});

it('should render the initial page', () => {
Terra.validates.element('initial', { selector: '#root' });
});

it('should render the clear overlay', () => {
browser.click('#clear-button');
$('#clear-button').click();

Terra.validates.element('clear overlay', { selector: '#root' });
});

it('should render the light overlay', () => {
browser.click('#reset-button');
browser.click('#light-button');
$('#reset-button').click();
$('#light-button').click();

Terra.validates.element('light overlay', { selector: '#root' });
});

it('should render the dark overlay', () => {
browser.click('#reset-button');
browser.click('#dark-button');
$('#reset-button').click();
$('#dark-button').click();

Terra.validates.element('dark overlay', { selector: '#root' });
});
Expand Down
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
58 changes: 29 additions & 29 deletions tests/wdio/application-navigation/application-navigation-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,59 +8,59 @@ Terra.describeViewports('ApplicationNavigation', ['large'], () => {
before(() => browser.url('/raw/tests/terra-application/application-navigation/application-navigation-test'));

it('prompts user when selecting primary navigation items', () => {
browser.click('#pending-action-toggle-1');
browser.click('div[aria-label="Page 2"]');
$('#pending-action-toggle-1').click();
$('div[aria-label="Page 2"]').click();

browser.waitForVisible(NOTIFICATION_DIALOG_SELECTOR);
$(NOTIFICATION_DIALOG_SELECTOR).waitForDisplayed();
Terra.validates.element('1. primary navigation item prompt', { selector });
});

it('rejects prompt on primary navigation', () => {
browser.click(REJECT_ACTION_SELECTOR);
$(REJECT_ACTION_SELECTOR).click();
Terra.validates.element('2. primary navigation item prompt reject', { selector: '[data-nav-test-content="true"]' });
});

it('prompts user when selecting primary navigation items and accepts prompt', () => {
browser.click('div[aria-label="Page 2"]');
browser.waitForVisible(NOTIFICATION_DIALOG_SELECTOR);
browser.click(ACCEPT_ACTION_SELECTOR);
$('div[aria-label="Page 2"]').click();
$(NOTIFICATION_DIALOG_SELECTOR).waitForDisplayed();
$(ACCEPT_ACTION_SELECTOR).click();
Terra.validates.element('3. primary navigation item prompt accept', { selector: '[data-nav-test-content="true"]' });
});

it('marks multiple items as pending and attempts to navigate away', () => {
browser.click('#pending-action-toggle-1');
browser.click('#pending-action-toggle-2');
browser.click('div[aria-label="Page 1"]');
browser.waitForVisible(NOTIFICATION_DIALOG_SELECTOR);
$('#pending-action-toggle-1').click();
$('#pending-action-toggle-2').click();
$('div[aria-label="Page 1"]').click();
$(NOTIFICATION_DIALOG_SELECTOR).waitForDisplayed();
Terra.validates.element('4. primary navigation item prompt with multiple prompts', { selector });
});

it('accept prompt on primary navigation with multiple prompts', () => {
browser.click(ACCEPT_ACTION_SELECTOR);
$(ACCEPT_ACTION_SELECTOR).click();
});

it('prompts user when selecting logout', () => {
browser.click('#pending-action-toggle-1');
browser.click('[data-application-header-utility="true"]');
browser.waitForVisible('[data-terra-popup-content="true"]');
browser.click('[data-terra-popup-content="true"] button');
$('#pending-action-toggle-1').click();
$('[data-application-header-utility="true"]').click();
$('[data-terra-popup-content="true"]').waitForDisplayed();
$('[data-terra-popup-content="true"] button').click();

browser.waitForVisible(NOTIFICATION_DIALOG_SELECTOR);
$(NOTIFICATION_DIALOG_SELECTOR).waitForDisplayed();
Terra.validates.element('5. logout prompt item prompt', { selector });
});

it('reject prompt on logout', () => {
browser.click(REJECT_ACTION_SELECTOR);
$(REJECT_ACTION_SELECTOR).click();
Terra.validates.element('6. logout prompt reject', { selector });
});

it('accepts prompt to successfully log out', () => {
browser.click('[data-application-header-utility="true"]');
browser.waitForVisible('[data-terra-popup-content="true"]');
browser.click('[data-terra-popup-content="true"] button');
$('[data-application-header-utility="true"]').click();
$('[data-terra-popup-content="true"]').waitForDisplayed();
$('[data-terra-popup-content="true"] button').click();

browser.waitForVisible(NOTIFICATION_DIALOG_SELECTOR);
browser.click(ACCEPT_ACTION_SELECTOR);
$(NOTIFICATION_DIALOG_SELECTOR).waitForDisplayed();
$(ACCEPT_ACTION_SELECTOR).click();
Terra.validates.element('7. logout prompt accept', { selector });
});
});
Expand All @@ -69,17 +69,17 @@ Terra.describeViewports('ApplicationNavigation', ['large'], () => {
before(() => browser.url('/raw/tests/terra-application/application-navigation/application-navigation-disabled-prompts-test'));

it('does not prompt user when selecting primary navigation items', () => {
browser.click('#pending-action-toggle');
browser.click('div[aria-label="Page 2"]');
$('#pending-action-toggle').click();
$('div[aria-label="Page 2"]').click();

Terra.validates.element('1. no prompt for primary navigation items', { selector });
});

it('does not prompt user when selecting logout', () => {
browser.click('#pending-action-toggle');
browser.click('[data-application-header-utility="true"]');
browser.waitForVisible('[data-terra-popup-content="true"]');
browser.click('[data-terra-popup-content="true"] button');
$('#pending-action-toggle').click();
$('[data-application-header-utility="true"]').click();
$('[data-terra-popup-content="true"]').waitForDisplayed();
$('[data-terra-popup-content="true"] button').click();

Terra.validates.element('2. no prompt for logout', { selector });
});
Expand Down
Loading

0 comments on commit b003f97

Please sign in to comment.