Skip to content

Commit

Permalink
Update Readme for ODC test (#28)
Browse files Browse the repository at this point in the history
* Update Readme for ODC test
  • Loading branch information
josephca authored Jul 6, 2021
1 parent d3312c3 commit 07f0d1f
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
34 changes: 32 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,36 @@ Tests in this repository are based on [ODO integration tests](https://github.com
Tests in this repository are based on [ODC integration tests](https://github.com/openshift/console#integration-tests).

### Prerequisites
- Cypress integration tests are implemented in [Cypress.io](https://www.cypress.io/).
1. [node.js](https://nodejs.org/) >= 14 & [yarn](https://yarnpkg.com/en/docs/install) >= 1.20
1. [go](https://golang.org/) >= 1.13+
1. [oc](https://mirror.openshift.com/pub/openshift-v4/clients/oc/4.4/) or [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) and an OpenShift or Kubernetes cluster. In this document, [CRC](https://cloud.redhat.com/openshift/create/local) is used.
1. [jq](https://stedolan.github.io/jq/download/) (for `contrib/environment.sh`)
1. Google Chrome/Chromium or Firefox for integration tests
1. Cypress - integration tests are implemented in [Cypress.io](https://www.cypress.io/).

See https://github.com/openshift/console#integration-tests for more detail on how to run devfile test with ODC.
### Run tests
1. install [CRC](https://cloud.redhat.com/openshift/create/local)
1. run `crc setup`
1. run `crc start` and record credentials for `kubeadmin`. You may obtain the credentials by running `crc console --credentials`
1. run `crc oc-env` to configure your shell
1. git clone OpenShift [console](https://github.com/openshift/console) repository
1. build `console`. Login as `kubeadmin` and start a local console.
```
cd console
./build.sh # Backend binaries are output to `./bin`
oc login -u kubeadmin -p <kubeadmin_password>
source ./contrib/oc-environment.sh
./bin/bridge
```
The console will be running at http://localhost:9000

1. Update `console/frontend/packages/dev-console/integration-tests/features/addFlow/create-from-devfile.feature` by adding TAG (@smoke) for scenarios to run tests.
1. Launch Cypress test runner
```
cd console/frontend
yarn run test-cypress-devconsole
```
1. click `create-from-devfile.feature` to run test
![alt text](./docs/images/cypress_console.png "Cypress test")

For more detail, see https://github.com/openshift/console#integration-tests.
Binary file added docs/images/cypress_console.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,15 @@ Feature: Create Application from Devfile
And user clicks Create button on Devfile page
Then user will be redirected to Topology page
And user is able to see workload "devfile-sample" in topology page


@regression @to-do
Scenario: Create the Devfiles workload from Developer Catalog: A-04-TC04
Given user is at Developer Catalog page
When user clicks on Devfiles type
And user clicks on Basic Python card
And user clicks on Create Application on the side drawer
And user enters Application name as "devfile-sample-python-basic-git-app" in DevFile page
And user enters Name as "devfile-sample-python-basic-git1"
And user clicks on Create
Then user is able to see workload "devfile-sample-python-basic-git1" in topology page

0 comments on commit 07f0d1f

Please sign in to comment.