Skip to content

Commit

Permalink
test: add test_example.py for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
sShaAanGg committed Oct 18, 2023
1 parent 1f98c9b commit b6c7089
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ name: Node.js CI and Playwright Tests
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

on:
# push:
# branches: [ "origin" ]
# pull_request:
# branches: [ "origin" ]
workflow_dispatch:
# schedule:
# # Test 3 times a day
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# name: Playwright Tests
# on:
# push:
# branches: [ "origin" ]
# pull_request:
# branches: [ "origin" ]
# schedule:
# # Test 3 times a day
# - cron: '0 */8 * * *'
Expand Down
17 changes: 17 additions & 0 deletions source/back-end/test/test_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import re
from playwright.sync_api import Page, expect

def test_has_title(page: Page):
page.goto("https://playwright.dev/")

# Expect a title "to contain" a substring.
expect(page).to_have_title(re.compile("Playwright"))

def test_get_started_link(page: Page):
page.goto("https://playwright.dev/")

# Click the get started link.
page.get_by_role("link", name="Get started").click()

# Expects page to have a heading with the name of Installation.
expect(page.get_by_role("heading", name="Installation")).to_be_visible()

0 comments on commit b6c7089

Please sign in to comment.