-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
af4f90b
commit 6c3e308
Showing
2 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Nightly Tests for Shiny Assistant | ||
|
||
on: | ||
schedule: | ||
- cron: "0 3 * * *" | ||
push: | ||
branches: | ||
- "testing**" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
process-issues: | ||
runs-on: ubuntu-latest | ||
permissions: write-all | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.x" | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "18" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
playwright install chromium --with-deps | ||
- name: Process issue description | ||
id: process-description | ||
run: python tests/run_smoke_test.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import time | ||
|
||
from playwright.sync_api import Playwright, sync_playwright | ||
|
||
|
||
def run(playwright: Playwright): | ||
chromium = playwright.chromium | ||
browser = chromium.launch() | ||
page = browser.new_page() | ||
page.goto("https://gallery.shinyapps.io/assistant") | ||
page.get_by_label("Python").check() | ||
page.get_by_text("Who can see my activity?").click() | ||
page.get_by_text("Who can see my activity?").click() | ||
page.get_by_role("textbox", name="Enter a message...").click() | ||
page.get_by_role("textbox", name="Enter a message...").fill( | ||
""" | ||
Help me write a shiny app with orange cards | ||
""" | ||
) | ||
page.get_by_label("Send message").click() | ||
time.sleep(12) # required since we are streaming responses | ||
message_contents = page.query_selector_all(".message-content") | ||
last_message_content = message_contents[-1].text_content() | ||
if "orange" not in last_message_content: | ||
raise AssertionError("Expected orange in last message content") | ||
browser.close() | ||
|
||
|
||
with sync_playwright() as playwright: | ||
run(playwright) |