{"id":23421107,"url":"https://github.com/nhsdigital/ravs-tests","last_synced_at":"2025-04-12T14:03:48.300Z","repository":{"id":247385583,"uuid":"793673054","full_name":"NHSDigital/ravs-tests","owner":"NHSDigital","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-09T16:30:55.000Z","size":13724760,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-09T17:41:28.427Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NHSDigital.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-29T16:49:10.000Z","updated_at":"2025-04-07T12:45:03.000Z","dependencies_parsed_at":"2024-07-19T16:28:31.413Z","dependency_job_id":"bec4aa53-44a1-4004-9e49-b643a23ac4e5","html_url":"https://github.com/NHSDigital/ravs-tests","commit_stats":null,"previous_names":["nhsdigital/ravs-tests"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NHSDigital%2Fravs-tests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NHSDigital%2Fravs-tests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NHSDigital%2Fravs-tests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NHSDigital%2Fravs-tests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NHSDigital","download_url":"https://codeload.github.com/NHSDigital/ravs-tests/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248578799,"owners_count":21127713,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-23T02:14:02.355Z","updated_at":"2025-04-12T14:03:48.275Z","avatar_url":"https://github.com/NHSDigital.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Repository Template\n\n[![CI/CD Pull Request](https://github.com/nhs-england-tools/repository-template/actions/workflows/cicd-1-pull-request.yaml/badge.svg)](https://github.com/nhs-england-tools/repository-template/actions/workflows/cicd-1-pull-request.yaml)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=repository-template\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=repository-template)\n\nStart with an overview or a brief description of what the project is about and what it does. For example -\n\nWelcome to our repository template designed to streamline your project setup! This robust template provides a reliable starting point for your new projects, covering an essential tech stack and encouraging best practices in documenting.\n\nThis repository template aims to foster a user-friendly development environment by ensuring that every included file is concise and adequately self-documented. By adhering to this standard, we can promote increased clarity and maintainability throughout your project's lifecycle. Bundled within this template are resources that pave the way for seamless repository creation. Currently supported technologies are:\n\n- Terraform\n- Docker\n\nMake use of this repository template to expedite your project setup and enhance your productivity right from the get-go. Enjoy the advantage of having a well-structured, self-documented project that reduces overhead and increases focus on what truly matters - coding!\n\n## Table of Contents\n\n- [Repository Template](#repository-template)\n  - [Table of Contents](#table-of-contents)\n  - [Setup](#setup)\n    - [Prerequisites](#prerequisites)\n    - [Configuration](#configuration)\n  - [Usage](#usage)\n    - [Testing](#testing)\n  - [Design](#design)\n    - [Diagrams](#diagrams)\n    - [Modularity](#modularity)\n  - [Contributing](#contributing)\n  - [Contacts](#contacts)\n  - [Licence](#licence)\n  - [Setup Make in windows](#setup-make-in-windows)\n- [WSL Set Up](#wsl-set-up)\n  - [Windows WSL Installation](#windows-wsl-installation)\n  - [Set up Visual Code to develop with WSL (optional)](#set-up-visual-code-to-develop-with-wsl-optional)\n  - [Install pytest](#install-pytest)\n  - [Git commits](#git-commits)\n- [RAVS Playwright Pytest BDD Tests](#ravs-playwright-pytest-bdd-tests)\n  - [Features](#features)\n  - [Getting Started](#getting-started)\n    - [Prerequisites](#prerequisites-1)\n    - [Installation](#installation)\n  - [Docker](#docker)\n    - [Build Docker Image](#build-docker-image)\n    - [Run Docker Container](#run-docker-container)\n    - [Usage](#usage-1)\n    - [Configuration](#configuration-1)\n    - [Folder Structure](#folder-structure)\n    - [Test Run Report](#test-run-report)\n  - [Contributing](#contributing-1)\n  - [License](#license)\n\n## Setup\n\nBy including preferably a one-liner or if necessary a set of clear CLI instructions we improve user experience. This should be a frictionless installation process that works on various operating systems (macOS, Linux, Windows WSL) and handles all the dependencies.\n\nClone the repository\n\n```shell\ngit clone https://github.com/nhs-england-tools/repository-template.git\ncd nhs-england-tools/repository-template\n```\n\n### Prerequisites\n\nThe following software packages, or their equivalents, are expected to be installed and configured:\n\n- [Docker](https://www.docker.com/) container runtime or a compatible tool, e.g. [Podman](https://podman.io/),\n- [asdf](https://asdf-vm.com/) version manager,\n- [GNU make](https://www.gnu.org/software/make/) 3.82 or later,\n- [GNU coreutils](https://www.gnu.org/software/coreutils/) and [GNU binutils](https://www.gnu.org/software/binutils/) may be required to build dependencies like Python, which may need to be compiled during installation. For macOS users, this has been scripted and automated by the `dotfiles` project; please see this [script](https://github.com/nhs-england-tools/dotfiles/blob/main/assets/20-install-base-packages.macos.sh) for details,\n- [Python](https://www.python.org/) required to run Git hooks,\n- [`jq`](https://jqlang.github.io/jq/) a lightweight and flexible command-line JSON processor.\n\n\u003e [!NOTE]\u003cbr\u003e\n\u003e The version of GNU make available by default on macOS is earlier than 3.82. You will need to upgrade it or certain `make` tasks will fail. On macOS, you will need [Homebrew](https://brew.sh/) installed, then to install `make`, like so:\n\u003e\n\u003e ```shell\n\u003e brew install make\n\u003e ```\n\u003e\n\u003e You will then see instructions to fix your `$PATH` variable to make the newly installed version available. If you are using [dotfiles](https://github.com/nhs-england-tools/dotfiles), this is all done for you.\n\n### Configuration\n\nInstallation and configuration of the toolchain dependencies\n\n```shell\nmake config\n```\n\n## Usage\n\nAfter a successful installation, provide an informative example of how this project can be used. Additional code snippets, screenshots and demos work well in this space. You may also link to the other documentation resources, e.g. the [User Guide](./docs/user-guide.md) to demonstrate more use cases and to show more features.\n\n### Testing\n\nThere are `make` tasks for you to configure to run your tests.  Run `make test` to see how they work.  You should be able to use the same entry points for local development as in your CI pipeline.\n\n## Design\n\n### Diagrams\n\nThe [C4 model](https://c4model.com/) is a simple and intuitive way to create software architecture diagrams that are clear, consistent, scalable and most importantly collaborative. This should result in documenting all the system interfaces, external dependencies and integration points.\n\n![Repository Template](./docs/diagrams/Repository_Template_GitHub_Generic.png)\n\n### Modularity\n\nMost of the projects are built with customisability and extendability in mind. At a minimum, this can be achieved by implementing service level configuration options and settings. The intention of this section is to show how this can be used. If the system processes data, you could mention here for example how the input is prepared for testing - anonymised, synthetic or live data.\n\n## Contributing\n\nDescribe or link templates on how to raise an issue, feature request or make a contribution to the codebase. Reference the other documentation files, like\n\n- Environment setup for contribution, i.e. `CONTRIBUTING.md`\n- Coding standards, branching, linting, practices for development and testing\n- Release process, versioning, changelog\n- Backlog, board, roadmap, ways of working\n- High-level requirements, guiding principles, decision records, etc.\n\n## Contacts\n\nProvide a way to contact the owners of this project. It can be a team, an individual or information on the means of getting in touch via active communication channels, e.g. opening a GitHub discussion, raising an issue, etc.\n\n## Licence\n\n\u003e The [LICENCE.md](./LICENCE.md) file will need to be updated with the correct year and owner\n\nUnless stated otherwise, the codebase is released under the MIT License. This covers both the codebase and any sample code in the documentation.\n\nAny HTML or Markdown documentation is [© Crown Copyright](https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/uk-government-licensing-framework/crown-copyright/) and available under the terms of the [Open Government Licence v3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).\n\n## Setup Make in windows\n\nLaunch a new powershell window as an admin and run this command to install chocolatey\n\n```Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))```\n\nThen install make using\n\n```choco install make```\n\nAfter installing make\n\n```make githook-run```\n\n# WSL Set Up\n\n## Windows WSL Installation\n\n[Install Linux on Windows with WSL](https://learn.microsoft.com/en-us/windows/wsl/install)\n\n__Notes:__\n- Unless otherwise specified, all commands are being run inside the Linux shell not Windows.\n- Before we get started, Windows WSL users may wish to run this command (in the Linux shell) to set the default path to home. Alternatively set the path in windows terminal - this will allow multiple profiles:\n\n```\necho -e '\\n# Set default path to linux home directory\\ncd ~' \u003e\u003e ~/.bashrc\n\nsource ~/.bashrc\n```\n\n- The WSL Ubuntu version might need openssl package to be updated, so run:\n\n```\nsudo apt upgrade \u0026\u0026 sudo apt update\n```\n\n(An out of date version of openssl will create problems with the self-signed certificate scripts.)\n\n## Set up Visual Code to develop with WSL (optional)\n\n[Configure Visual Studio Code to develop in WSL](VSCODE.md)\n\n## Install pytest\n\n```bash\npip install -U pytest\nsudo apt-get update\nsudo apt-get install jq\n```\n## Git commits\n\nIn order to make git commits to this repo, you need to use the following command in terminal\n\n```bash\nwsl\n```\nNeed to configure git credentials in wsl and this is the command to make commits to the repo\n\n```bash\nPRE_COMMIT_ALLOW_NO_CONFIG=1 git commit -m \"commit message\"\n```\n\n# RAVS Playwright Pytest BDD Tests\n\nThis is a project for setting up and running end-to-end tests using Playwright, Pytest, and the Behavior-Driven Development (BDD) approach. It utilizes the dependency injection design pattern to provide a flexible and modular testing framework. It provides a flexible and modular testing framework, allowing for easy integration into future projects.\n\n## Features\n\n- **Playwright**: A Python library for automating browsers based on the powerful Playwright toolset.\n- **Pytest**: A testing framework that makes it easy to write simple and scalable tests.\n- **Behavior-Driven Development (BDD)**: A methodology for writing tests in simple, natural language constructs, making them more accessible to non-technical stakeholders.\n- **Dependency Injection**: The project leverages the dependency injection design pattern to manage dependencies and promote code reusability and testability.\n\n## Getting Started\n\n### Prerequisites\n\n- Python installed on your machine\n- Pip package manager\n\n### Installation\n\n1. Clone this repository:\n\n  ```bash\n  git clone git@github.com:NHSDigital/ravs-tests.git\n  ```\n2. Navigate to the project directory:\n\n  ```bash\n  cd ravs-tests\n  ```\n\n3. Install dependencies:\n\n  ```bash\n  pip install -r requirements.txt\n  ```\n## Docker\n\n### Build Docker Image\n\nBuild the Docker image using the following command:\n\n```bash\ndocker build -t your_docker_image_name -f Docker/tests.dockerfile .\n```\n### Run Docker Container\n\nRun the Docker container using the following command:\n\n```bash\ndocker run -it -p 5050:5050 \\\n  -e RAVS_PASSWORD=$env:RAVS_PASSWORD \\\n  -e HEADLESS_MODE=\"true\" \\\n  -e TEST_ENVIRONMENT=\"qa\" \\\n  -e BROWSER=\"chrome\" \\\n  -e DEVICE=\"iphone_12\" \\\n  -e MARKER=\"login\" \\\n  -e AGENTS=3 \\\n  your_docker_image_name\n```\nReplace your_docker_image_name with the desired name for your Docker image. This command will run the Docker container with the specified environment variables, including the password, headless mode, test environment, browser, and device configuration.\n\n### Usage\n\n1. Write your feature files using Gherkin syntax in the `features` directory.\n2. Implement your step definitions in the `steps` directory using Python.\n3. Run the tests using the following command:\n\n    ```bash\n    # For Windows\n    scoop install allure\n\n    # For Linux\n    apt-get update \u0026\u0026 apt-get install -y allure\n\n    # Set the password, headless mode, test environment, and browser variables and run the tests\n    $env:RAVS_PASSWORD = \"YourPasswordHere\"; $env:HEADLESS_MODE = \"false\"; $env:TEST_ENVIRONMENT= \"qa\"; $env:BROWSER= \"chrome\"; $env:DEVICE= \"iphone_12\" ; $env:MARKER= \"\" ; $env:AGENTS= 3 tox\n    ```\n### Configuration\n\n- Modify the `pytest.ini` file to configure Pytest options and plugins.\n- Update the `tox.ini` file to define the test environments and configurations.\n\n### Folder Structure\n- features\n- steps\n- pages\n- helpers\n- pages\n- Docker\n\n### Test Run Report\n\nThe latest test run report can be found ([here](https://allure-report-ravs.netlify.app/#))\n\n## Contributing\n\nContributions are welcome! If you have suggestions, improvements, or new features to add, feel free to open an issue or submit a pull request.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnhsdigital%2Fravs-tests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnhsdigital%2Fravs-tests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnhsdigital%2Fravs-tests/lists"}