In order to access the https://[env].foo.redhat.com in your browser, you have to add entries to your /etc/hosts
file. This is a one-time setup that has to be done only once (unless you modify hosts) on each machine.
To setup the hosts file run following command:
yarn patch:hosts
Alternatively, add these lines to your /etc/hosts file:
127.0.0.1 prod.foo.redhat.com
::1 prod.foo.redhat.com
127.0.0.1 stage.foo.redhat.com
::1 stage.foo.redhat.com
127.0.0.1 qa.foo.redhat.com
::1 qa.foo.redhat.com
127.0.0.1 ci.foo.redhat.com
::1 ci.foo.redhat.com
-
Make sure nvm is installed
-
To ensure you have the correct node version installed do:
nvm use
. Yarn WILL prevent you from progressing if you have not updated your node version to match the one in the .nvmrc file. -
yarn install
-
yarn build
(only required when setting up for the first time)
Keep in mind that you have to be connected to the VPN for this to work, even in the offices.
-
yarn start
to choose whether to run against stage or prod environments.
OR
yarn start:stage
to run against stage environment.
OR
yarn start:prod
to run against prod environment.
OR
yarn local
to run against a local backend running on port 8000. -
With a browser, open the URL listed in the terminal output, https://stage.foo.redhat.com:1337/insights/content for example.
yarn verify
will run yarn build
yarn lint
(eslint), yarn format:check
Prettier formatting check and yarn test
(Jest unit tests)
One can also: yarn test
to run the unit tests directly.
-
Ensure the correct node version is installed and in use:
nvm use
-
Copy the example env file and create a file named:
.env
For local development only the BASE_URL:https://stage.foo.redhat.com:1337
is required, which is already set in the example config. -
Install Playwright browsers and dependencies
yarn playwright install
OR
If using any os other than Fedora/Rhel (IE:mac, ubuntu linux):
yarn playwright install --with-deps
-
Run the backend locally, steps to do this can be found in the backend repository.
Ensure that the backend is running prior to the following steps.
-
yarn local
will start up the front-end repository. If you doyarn start
and choose stage, your tests will attempt to run against the stage ENV, please do not test in stage. -
yarn playwright test
will run the playwright test suite.yarn playwright test --headed
will run the suite in a vnc-like browser so you can watch it's interactions.
It is recommended to test using vs-code and the Playwright Test module for VSCode. But other editors do have similar plugins to for ease of use, if so desired
The CICD pipeline for playwright (both front-end and backend) will check in the description of the front-end PRs for the following formatted text:
#testwith https://github.com/content-services/content-sources-backend/pull/<PR NUMBER>
Note the space in #testwith https
.
If a backend PR is linked, the front-end and back-end PR's in question will both use the corresponding linked branch for their Playwright tests in the PR check.
- The starter repo uses Travis to deploy the webpack build to another Github repo defined in
.travis.yml
- That Github repo has the following branches:
ci-beta
(deployed by pushing tomaster
ormain
on this repo)ci-stable
(deployed by pushing toci-stable
on this repo)qa-beta
(deployed by pushing toqa-beta
on this repo)qa-stable
(deployed by pushing toqa-stable
on this repo)prod-beta
(deployed by pushing toprod-beta
on this repo)prod-stable
(deployed by pushing toprod-stable
on this repo)
- That Github repo has the following branches:
- Travis uploads results to RedHatInsight's codecov account. To change the account, modify CODECOV_TOKEN on https://travis-ci.com/.