Skip to content

Commit

Permalink
OZ-534: Refactor Ozone e2e test suite README into Ozone Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kdaud committed Apr 17, 2024
1 parent af0d1d0 commit ef3444d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 77 deletions.
87 changes: 11 additions & 76 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,79 +1,14 @@
# Ozone E2E Test Suite
<p align="center">
<a href="https://docs.ozone-his.com/"><img src="https://www.ozone-his.com/wp-content/uploads/2021/11/Ozone-Logo.png" alt="Ozone" width="30%"/></a>
</p>

[![Ozone E2E Tests](https://github.com/ozone-his/ozone-e2e/actions/workflows/pro.yml/badge.svg)](https://github.com/ozone-his/ozone-e2e/actions/workflows/pro.yml)
<h3 align="center">Health Information System</h3>

Welcome to Ozone automated test suite.
<p align="center">
Welcome to Ozone's open-source repositories!
<br/>Engage with the Ozone community and access useful resources below!
</p>

- [Setup Steps](#setup-steps)
* [Step 1. Setup the project](#step-1-setup-the-project)
* [Step 2. Run Ozone e2e tests](#step-2-run-ozone-e2e)
- [Configurations](#configurations)
- [Project Structure](#project-structure)
- [Guide for writing tests](#guide-for-writing-tests)
- [GitHub Actions integration](#github-actions-integration)

<small><i><a href='http://ecotrust-canada.github.io/markdown-toc/'>(Table of contents generated with markdown-toc)</a></i></small>

## Setup Steps

### Step 1. Setup the project

Clone the project

```sh
git clone https://github.com/ozone-his/ozone-e2e
```
Navigate into the project

```sh
cd ozone-e2e
```

Install dependencies
```sh
yarn install
```

### Step 2. Run Ozone e2e tests

```sh
npx playwright test
```
## Configurations

This is underdevelopement/WIP. At the moment, there exists a git-shared
`.env` file used for configuring environment variables.

By default, the test suite will run against Ozone dev server.
You can override it by changing the environment variables beforehand:

```sh
# Ex: Set the server URL here
export E2E_BASE_URL=https://ozone-dev.mekomsolutions.net
```

## Project Structure
The project uses the Playwright test runner and,
generally, follows a very simple project structure:

```
e2e
|__ tests
| ^ Contains test cases
|__ utils
| ^ Contains utilities needed to setup and tear down
| tests as well as methods required by the tests to run
```

## Guide for writing tests

When writing a new test case, create a new spec in `./e2e/tests`

## GitHub Actions integration
The pro.yml workflow is split into two jobs, one that runs upon _Git pull requests_, and _Git push(es)_. The other runs tests on an environment specified during runtime. The difference between the two is that, the later is run manually via GitHub Actions. Note: When manually running the tests, you need to choose the test environment at runtime.

<img src="readme/choose_test_environment.png" alt="Choose Test Environment" width="1000"/>

The foss.yml workflow contains one job that runs Ozone FOSS specific tests. Note: You need to provide O3, Odoo and SENAITE base URLs at runtime.

<img src="readme/user_inputs.png" alt="User Inputs" width="1000"/>
<h3 align="center">
<a href="https://docs.ozone-his.com/">Docs</a>&nbsp;&nbsp;&nbsp;&nbsp;•&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://talk.openmrs.org/c/software/ozone-his/70">Forum</a>&nbsp;&nbsp;&nbsp;&nbsp;•&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://openmrs.slack.com/archives/C02PYQD5D0A">Chat Room</a>
</h3>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"!playwright-report/"
],
"scripts": {
"proE2ETests": "npx playwright test",
"proE2ETests": "npx playwright test Analytics",
"fossE2ETests": "npx playwright test Odoo Senaite"
},
"publishConfig": {
Expand Down
Binary file removed readme/choose_test_environment.png
Binary file not shown.
Binary file removed readme/user_inputs.png
Binary file not shown.

0 comments on commit ef3444d

Please sign in to comment.