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

Commit

Permalink
[terra-toolkit-docs] Update terra-functional-testing upgrade guide (#648
Browse files Browse the repository at this point in the history
)

* Added additional notes to the terra-functional-testing upgrade guide.

* Move express-server CLI command from terra-open-source-scripts to terra-functional-testing to eliminate the need to depend on terra-open-source-scripts to use express-server.

* This should not be committed.

* revert documentation.
  • Loading branch information
benbcai authored May 7, 2021
1 parent 1db98eb commit f8b7792
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 186 deletions.
1 change: 1 addition & 0 deletions packages/terra-functional-testing/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* Added
* Added useSeleniumStandaloneService option for using the standalone-chrome host instead of the selenium docker service when building in Jenkins.
* Added express-server CLI command. This is moved from @cerner/terra-open-source-scripts.

* Fixed
* Update node-resemble-js version to fix `Stream not writable` error.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const ExpressServer = require('./ExpressServer');
const ExpressServer = require('../../express-server');

module.exports = async (options) => {
const server = new ExpressServer({
Expand All @@ -7,6 +7,5 @@ module.exports = async (options) => {
site: options.site,
});

await server.createApp();
await server.start();
};
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
const mockCreateApp = jest.fn();
const mockStart = jest.fn();
jest.mock('../../../../src/terra-cli/express-server/ExpressServer', () => jest.fn().mockImplementation(() => ({
jest.mock('../../../../src/express-server', () => jest.fn().mockImplementation(() => ({
createApp: mockCreateApp,
start: mockStart,
})));

const expressHandler = require('../../../../src/terra-cli/express-server/expressServerHandler');
const ExpressServer = require('../../../../src/terra-cli/express-server/ExpressServer');
const ExpressServer = require('../../../../src/express-server');

describe('expressHandler', () => {
it('takes in options and starts the express server', async () => {
await expressHandler({ host: 'host', port: 'port', site: 'site' });

expect(ExpressServer).toHaveBeenCalledWith({ host: 'host', port: 'port', site: 'site' });
expect(mockCreateApp).toHaveBeenCalled();
expect(mockStart).toHaveBeenCalled();
});
});
3 changes: 3 additions & 0 deletions packages/terra-open-source-scripts/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

* Removed
* Removed express-server CLI command. This is moved to @cerner/terra-functional-testing to eliminate the need to depend on this package to use express-server.

## 1.8.0 - (April 23, 2021)

* Changed
Expand Down
1 change: 0 additions & 1 deletion packages/terra-open-source-scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

Terra's common open source scripts provided as [terra-cli](https://www.npmjs.org/package/@cerner/terra-cli) commands. These are intended to be used by terra projects and not for use outside of that ecosystem. Currently, this package provides:

* express-server - launches a very simple express server to host static content
* prepare-for-release - prepares a given project for release by updating versions and changelogs. Supports both single and mono repos
* release - releases a given project to npm and tags it in git. Supports both single and mono repos

Expand Down

This file was deleted.

This file was deleted.

3 changes: 3 additions & 0 deletions packages/terra-toolkit-docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

* Added
* Added additional notes to the terra-functional-testing upgrade guide.

## 1.11.0 - (May 4, 2021)

* Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,14 @@ Check out the [release notes](https://github.com/dequelabs/axe-core/releases) fo

The default selector has been changed from `[data-terra-dev-site-content] *:first-child` to `[data-terra-test-content] *:first-child`. This selector is used as the default content region for capturing screenshots. This change should not affect most teams. For teams that are affected a custom selector can be provided using [service options](https://engineering.cerner.com/terra-ui/dev_tools/cerner/terra-functional-testing/wdio-services/terra-service#selector).

### Accessing the `formFactor`, `locale`, or `theme` options

The `formFactor`, `locale`, and `theme` options that used to be available in the `browser.options` global object no longer reside in this object. These options along with other data are now available in the `Terra.serviceOptions` global object.

### Accessing the `browser` object

Any usage of the `browser` global object should be moved inside the `it` block because `browser` will be `undefined` when accessed outside the scope of the `it` block. This reason for this behavior is due to how the WebDriverIO testing lifecycle hooks are implemented in v6.

## New Features

### Accessibility Reporter
Expand Down Expand Up @@ -317,7 +325,7 @@ npm run start-prod
npm run start-static
```

Note: If you don't have some of these commands it is not necessary to add them. Just ensure the commands you do have are working as expected. All of the `tt-serve` commands should be updated to use webpack-dev-server or the terra express server
Note: If you don't have some of these commands it is not necessary to add them. Just ensure the commands you do have are working as expected. All of the `tt-serve` commands should be updated to use webpack-dev-server or the terra express server.

### Upgrading ESlint Config Terra

Expand Down

0 comments on commit f8b7792

Please sign in to comment.