11# Contributing To This Project
22
33This document outlines the general guidance that should be applied when contributing new code to this project,
4- to ensure that coding standards and principals remain consistent throughout the project.
4+ to ensure that coding standards and principles remain consistent throughout the project.
55
66## Table of Contents
77
88- [ Contributing To This Project] ( #contributing-to-this-project )
99 - [ Table of Contents] ( #table-of-contents )
10- - [ General Principals ] ( #general-principals )
10+ - [ General Principles ] ( #general-principles )
1111 - [ Use Playwright and pytest documentation as our standard] ( #use-playwright-and-pytest-documentation-as-our-standard )
1212 - [ Proving tests work before raising a pull request] ( #proving-tests-work-before-raising-a-pull-request )
1313 - [ Evidencing tests] ( #evidencing-tests )
@@ -26,11 +26,11 @@ to ensure that coding standards and principals remain consistent throughout the
2626 - [ Package management] ( #package-management )
2727 - [ Last Reviewed] ( #last-reviewed )
2828
29- ## General Principals
29+ ## General Principles
3030
3131### Use Playwright and pytest documentation as our standard
3232
33- When contributing to this project, we should by default following the guidance outlined in the
33+ When contributing to this project, we should be following the guidance outlined in the
3434[ Playwright] ( https://playwright.dev/python/docs/api/class-playwright ) and
3535[ pytest] ( https://docs.pytest.org/en/stable/ )
3636documentation in the first instance to ensure our code remains as close to the recommended standard as possible.
@@ -50,27 +50,28 @@ not work as intended). This can either be done locally or via a pipeline/workflo
5050
5151When we create new tests, or significantly change the functionality of a test, we should demonstrate these tests work
5252by [ recording the trace using Playwright] ( https://playwright.dev/python/docs/trace-viewer-intro ) and attaching the
53- generated trace file to the associated ticket within Jira.
53+ generated trace file to the associated ticket within <!-- vale off --> Jira<!-- vale on --> .
5454
55- > NOTE: If the trace file exceeds the maximum file attachment size for Jira, we should upload the file to a Confluence page
56- > instead and link this back to the ticket.
55+ > NOTE: If the trace file exceeds the maximum file attachment size for <!-- vale off --> Jira <!-- vale on --> , we should
56+ > upload the file to a Confluence page instead and link this back to the ticket.
5757
5858When we modify existing tests (including any page objects or utilities used by these tests) but the behaviour of the test
59- has not fundamentally changed, we should upload the generated HTML report from the Playwright execution to the Jira ticket.
59+ has not fundamentally changed, we should upload the generated HTML report from the Playwright execution to the
60+ <!-- vale off --> Jira<!-- vale on --> ticket.
6061
6162#### Example
6263
63- We introduce a new test that covers the send a kit functionality for a single subject using codegen in the first instance.
64+ We introduce a new test that covers the send a kit functionality for a single subject using ` codegen ` in the first instance.
6465To demonstrate this test has worked as intended, we should turn tracing on and generate a trace file from Playwright and
65- attach this to the ticket in Jira.
66+ attach this to the ticket in <!-- vale off --> Jira<!-- vale on --> .
6667
6768We then decide to refactor the test so that it uses a page object model for the send a kit page, but this does not change
6869the behaviour of the test in any way (just makes the elements reusable). In this instance, we should upload the HTML report
69- to the Jira ticket showing the test passing as the logic of the test has not changed in any way.
70+ to the <!-- vale off --> Jira<!-- vale on --> ticket showing the test passing as the logic of the test has not changed in any way.
7071
7172We then decide to create a utility that loops through several subjects at once and apply this to the previously created send
7273a kit test. In this instance, we should turn tracing on again and generate a trace file from Playwright and attach this to the
73- ticket in Jira, because the logic of the test has fundamentally changed.
74+ ticket in <!-- vale off --> Jira<!-- vale on --> , because the logic of the test has fundamentally changed.
7475
7576## Coding Practices
7677
@@ -112,8 +113,8 @@ The following guidance applies to any files in the /pages directory.
112113
113114For any newly created page objects, we should apply the following logic:
114115
115- - The filename should end with _ page (Example: send_a_kit_page.py)
116- - The class name should end with Page (Example: SendAKitPage)
116+ - The filename should end with ` _page ` (Example: ` send_a_kit_page.py ` )
117+ - The class name should end with ` Page ` (Example: ` SendAKitPage ` )
117118
118119#### Docstring
119120
@@ -124,7 +125,7 @@ where possible.
124125
125126##### Example
126127
127- def ExamplePage:
128+ class ExamplePage:
128129
129130 def __init__(page: Page) -> None:
130131 self.page = page
@@ -171,4 +172,4 @@ appropriate testing, we need to have critically reviewed the package and ensure
171172
172173## Last Reviewed
173174
174- This document was last reviewed on 01/05/2023 .
175+ This document was last reviewed on 01/05/2025 .
0 commit comments