You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can clone this whole repository by clicking on the green `Code` button at near the top of the screen, then select either ssh or https, depending on if you have your ssh key setup
29
25
30
26
### Prerequisites
31
27
32
-
To utilise the blueprint code, you will need to have the following installed:
28
+
#### Python3
33
29
34
-
-[Python](https://www.python.org/downloads/) 3.12 or greater
30
+
To utilise the test for the BCSS app you will first of all require python3. The installation method changes based on operating systems but can usually be installed from a software store.
35
31
36
-
Whilst not required to get started, you may also want to [configure a Python virtual environment for your project](https://docs.python.org/3/library/venv.html) before proceeding with
37
-
the configuration. If you are using an IDE such as Visual Studio Code or PyCharm, you will normally be prompted to do this automatically.
32
+
#### Virtual Environment
38
33
39
-
### Configuration
34
+
To avoid conflicts with the rest of the operating system it is reccomended to create a python virtual environment, this isolates any packages installed and makes your life easier. To do that run the following command:
40
35
41
-
There is a makefile which has common commands to interface with the repository, to check if the tests are working you can run the command `make test`
36
+
`python -m venv .venv`
42
37
43
-
The first time you run this it will create a container using buildah and podman, it will then install the prerequisites onto it and copy over the code before executing `pytest` to run all the tests. This is the reccomended way to run the tests
38
+
This will create a bunch of files under a directory called `.venv` if you are using Visual Studios Code then it should automatically detect this environment and use it, but you may need to restart VSCode to pick up this new virtual environment
44
39
45
-
If you prefer to run the tests locally you can do so by first assuming the python virtual environment, vscode should pick it up automatically in the `venv` directory but if you are using the terminal on linux or mac you can run `source venv/bin/activate` If you are using windows it may work the same for you or you may need to lookup how to assume a python virtual environment.
40
+
#### Python Packages
46
41
47
-
Once that is done you can run the following commands to install the prerequisites:
42
+
There are a bunch of packages that are required to run the tests in this repository, they have been tracked in the `requirements.txt` file. To install them run this command:
48
43
49
44
```bash
50
45
pip install -r requirements.txt
51
-
playwright install --with-deps
52
46
```
53
47
54
-
> **Note** I found that trying to run this on fedora let to some errors, only Ubuntu seems to be supported which is why I have setup a container using ubuntu to support other environments
48
+
This will then install all of the dependancies.
55
49
56
-
This will install all the necessary packages for executing Playwright tests, and install Playwright ready for use by the framework. You can test the configuration
57
-
has worked by running our example tests, which can be done using the following command (this will run all tests with tracing reports turned on, and in headed mode
58
-
so you can see the browser execution):
50
+
#### Playwright
59
51
60
-
```shell
61
-
pytest --tracing on --headed
52
+
Once all the pre-requisites have been installed then you can install playwright with the following command:
53
+
54
+
```bash
55
+
playwright install --with-deps
62
56
```
63
57
58
+
This will take a while and will install playwright and its browsers which allow it to run the tests.
59
+
60
+
### Configuration
61
+
62
+
There is a makefile which has common commands to interface with the repository, to check if the tests are working you can run the command `make test`
63
+
64
+
There is also a dockerised version which will create a container using podman and run it there, if you dont have a compatible OS or you dont want to install the dependancies directly, however you will need to install podman and podman-build, you can run that with `podman-test`
65
+
64
66
## Getting Started
65
67
66
68
> NOTE: This section is currently under development and requires further work, so links to pages within this repository may not be very useful at this stage.
67
69
68
70
Once you've confirmed your installation is working, please take a look at the following guides on getting started with Playwright Python.
We've also created a [Quick Reference Guide](./docs/getting-started/Quick_Reference_Guide.md) for common commands and actions you may regularly perform using this blueprint.
74
-
75
-
For additional reading and guidance on writing tests, we also recommend reviewing the [Playwright Python documentation](https://playwright.dev/python/docs/writing-tests).
72
+
-[Quick Reference Guide](./docs/getting-started/Quick_Reference_Guide.md) for common commands and actions you may regularly perform using this blueprint.
73
+
-[Playwright Python documentation](https://playwright.dev/python/docs/writing-tests) guidance on writing tests.
0 commit comments