GitHunt
CO

cookiescrumbs/ui-api-test-framework-python

A UI and API test framework using Cypress & httpretty (Python)

UI and API test framework

This test framework uses Cypress & Typescript for e2e testing the UI.

Docker & Docker compose ๐Ÿณ to run the tests locally in containers or via a build pipeline platform ( like circleci ... there are other flavours)๐Ÿฆ

Usage

If you just want to run the tests you only need docker. Install Docker Desktop ๐Ÿณ

Run the UI tests in a Docker container

If you have an M1, you'll need to run this command docker compose run ui-tests-m1 npm run test ๐Ÿƒ๐Ÿฟ

If you are on the old school Mac or anything that isn't ARM64 then you'll need to run this

docker-compose run ui-tests npm run test ๐Ÿƒโ€โ™€๏ธ

Run the API tests in a Docker container

docker-compose run api-tests npm run test ๐Ÿƒโ€โ™€๏ธ

Local development

First, you'll need to install node.... ๐Ÿค–

I like to use FNM ๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป and the Node Version is 16.14.0

To setup the local development for this framework you can run ๐Ÿข ๐Ÿ’จ

npm run setup-local-dev

This will install dependencies for you to work on the UI and API tests locally.

Run the UI test in headless mode via Cypress ๐Ÿƒ๐Ÿปโ€โ™‚๏ธ

npm run ui-tests:run

Open the UI tests in the Cypress GUI ๐Ÿƒโ€โ™€๏ธ

npm run ui-tests:open

Feature File .. but no cucumber?! ๐Ÿฅ’

You'll find a feature file in the root of the project that outlines the scenarios that have been tested.
This file is written in Gherkin but you'll find no cucmber ๐Ÿฅ’ steps in the tests.

I've used the Gherkin syntax to outline the acceptance critera. I find that it can be a good tool for defining the requirements of a new feature ideally in
3 Amigos session ๐ŸงŸโ€โ™€๏ธ ๐Ÿง™๐Ÿปโ€โ™€๏ธ ๐Ÿฆน๐Ÿปโ€โ™€๏ธ

Issues ๐Ÿ‘ป

โ˜ ๏ธ Running Cypress inside a Docker container using an Apple M1 ARM64 Processor has some issues โ˜ ๏ธ

I've managed to solve the issue by creating a Docker image just for ARM64, as suggested on this github thread

The Docker image can be found here cookiescrumbs/cypress-m1:9.4.1

The image has Cypress v9.4.1 baked into it. ๐ŸŽ‚