Skip to content

Commit 6805911

Browse files
committed
Tests
1 parent 05a6072 commit 6805911

File tree

5 files changed

+53
-40
lines changed

5 files changed

+53
-40
lines changed

tests/axetest.py

Lines changed: 0 additions & 20 deletions
This file was deleted.

tests/htmlcstest.py

Lines changed: 0 additions & 20 deletions
This file was deleted.

tests/test.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!Doctype Html>
2+
<Html>
3+
<Head>
4+
<Title>
5+
Login form
6+
</Title>
7+
</Head>
8+
<Body>
9+
Login form:
10+
<form>
11+
<label>User Id: </label> <br>
12+
<input type="text"> <br> <br>
13+
<label>Password:</label> <br>
14+
<input type="password"> <br> <br>
15+
<input type="submit" value="Submit">
16+
</form>
17+
</Body>
18+
</Html>

tests/test_axe.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from pathlib import Path
2+
3+
from playwright.sync_api import Page
4+
5+
from automateda11y.pw.axerunner import AxeRunner
6+
from automateda11y.pw.settings import Settings
7+
8+
9+
def root_dir():
10+
return Path(__file__).parent.parent.__str__()
11+
12+
13+
def test_register_link(page: Page):
14+
Settings.report_dir = root_dir() + '/reports'
15+
page.goto("file://"+root_dir()+"/tests/test.html")
16+
data = AxeRunner(page).set_page_title("Page Title").execute()
17+
assert len(data.violations) == 2

tests/test_htmlcs.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import os
2+
from pathlib import Path
3+
4+
from playwright.sync_api import Page
5+
6+
from automateda11y.pw.htmlcsrunner import HtmlCsRunner
7+
from automateda11y.pw.settings import Settings
8+
9+
10+
def root_dir():
11+
return Path(__file__).parent.parent.__str__()
12+
13+
14+
def test_register_link(page: Page):
15+
Settings.report_dir = root_dir() + '/reports'
16+
page.goto("file://"+root_dir()+"/tests/test.html")
17+
data = HtmlCsRunner(page).set_standard().set_page_title("Page Title").set_ignore_code([]).execute()
18+
assert data.errors == 5

0 commit comments

Comments
 (0)