Skip to content

Commit

Permalink
TESTING : Fixed regression test bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
crdoconnor committed Aug 27, 2023
1 parent 1f410a9 commit 2170f72
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 17 deletions.
1 change: 1 addition & 0 deletions .github/workflows/regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
touch ~/.ssh/id_rsa
touch ~/.ssh/id_rsa.pub
echo test | podman secret create pypitoken -
echo ${{ secrets.GITHUB_TOKEN }} | podman secret create githubtoken
./key.sh make
- name: regression
Expand Down
47 changes: 30 additions & 17 deletions hitch/story/quickstart.story
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Quickstart:
text: next
iframe:
element:
iframe message: "#id_iframe_page"
iframe page title: "#id_iframe_title"

html:
index.html: |
Expand All @@ -38,16 +38,19 @@ Quickstart:
</div>
iframe.html: |
<div class="form-login">
<h4 id="id_iframe_page">This is an iframe page</h4>
<h4 id="id_iframe_title">This page contains an iframe</h4>
<iframe id="message_iframe" src="iframe_content.html" />
</div>
iframe_content.html: |
<p id="id_dashboard_message">hello!</a>
setup: |
from playwright.sync_api import expect, sync_playwright
from page_config_model import PlaywrightPageConfig
from pathlib import Path

browser = sync_playwright().start().chromium.connect("ws://127.0.0.1:3605")
page = browser.new_page()

conf = PlaywrightPageConfig(
*Path(".").glob("*.yml"), # all .yml files in this folder
playwright_page=page,
Expand All @@ -56,17 +59,27 @@ Quickstart:
page.goto("http://localhost:8001")

steps:
- Run:
code: |
conf.next_page("login")
conf.element("username").fill("myusername")
conf.element("password").fill("mypassword")
conf.element("ok").click()

conf.next_page("dashboard")
expect(conf.element("message")).to_be_visible()

conf.element("next").click()
conf.next_page("iframe")
expect(conf.element("iframe message")).to_be_visible()
- Run:
code: |
conf.next_page("login")
print("login page")
conf.element("username").fill("myusername")
conf.element("password").fill("mypassword")
conf.element("ok").click()

conf.next_page("dashboard")
print("dashboard page")
expect(conf.element("message")).to_be_visible()

conf.element("next").click()
conf.next_page("iframe")
print("iframe page")
expect(conf.element("iframe page title")).to_be_visible()
#expect(conf.element("iframe contents")).to_be_visible()

will output: |-
login page
dashboard page
iframe page


0 comments on commit 2170f72

Please sign in to comment.