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

[terra-toolkit-docs] Update terra-functional-testing upgrade guide #648

Merged
merged 5 commits into from
May 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will now use the express-server that is currently in terra-functional-testing.


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

await server.createApp();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the call to createApp() because it is already being called inside start(). This is also to match AssetServerService where calling createApp() is not needed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was gonna ask about that :)

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically non passive. Though for our uses, I'm not sure if it will affect us since for us most, if not all, packages that use the open source scripts, also use terra-functional testing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I searched in github for all the places that depend on @cerner/terra-open-source-scripts. There are a few but they all already also depend on @cerner/terra-functional-testing so this should continue to work for them.

* 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