Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
8 changes: 4 additions & 4 deletions .github/workflows/render.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: GuideFrame Video Render
on: [push]
# All jobs in the workflow
jobs:
tutors-test:
render-tutors-demo:
runs-on: ubuntu-latest
# steps to run
steps:
Expand Down Expand Up @@ -31,10 +31,10 @@ jobs:
nohup Xvfb :99 -screen 0 1920x1080x24 &

# Run the Python script
python3 tutors_test.py github
python3 guideframe_tutors_demo.py github
# Upload the screen recording as an artifact
- name: Upload screen recording as artifact
uses: actions/upload-artifact@v4
with:
name: tutors-test
path: ./tutors_test*.mp4
name: render-tutors-demo
path: ./guideframe_tutors_demo*.mp4
35 changes: 35 additions & 0 deletions guideframe_tutors_demo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## Step 1
This brief GuideFrame demo begins by opening tutors.dev. This is achieved by using the open u r l function prior to step 1.

## Step 2
We can demonstrate the ability to pass multiple actions to GuideFrame by activating dark mode. This involves 3 calls to the click element function. We'll also call the sleep function for 0.5 seconds between each action.

## Step 3
Now let's use the hover and click function to move to the tutors reference manual.

## Step 4
We can pass None to lambda in order to hang on a page. This is useful for when you wish to simply add voiceover to a static page. Let's use the hover over element function a few times here. We'll also pass the order argument. This ensures that the action begins before the voiceover.

## Step 5
We'll start with the getting started card.

## Step 6
Now let's move on to the simple starter card.

## Step 7
Let's continue to the alternative starter card. Before using the scroll to element function to move to the reference course.

## Step 8
In this case, we use this function to access an element that isn't in the display window.

## Step 9
Let's use the click element by xpath function. We'll use it to access the search bar at the top of the screen.

## Step 10
With the search bar open, let's use the type into field function to type in card.

## Step 11
Let's open the link in the first result in a new tab. We can do this by using the open link in new tab function.

## Step 12
And that concludes this GuideFrame demonstration.
53 changes: 34 additions & 19 deletions tutors_test.py → guideframe_tutors_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,8 @@
from guideframe.utils import guide_step, get_env_settings # Importing the guide_step and get_env_settings functions from guideframe_utils.py


'''
As of GUIDEFRAME-31 as much logic as possible has been moved to external files to aid legibility
and promote the ability to have easily create a new test without having to adjust the GuideFrame logic itself.
This version also features the markdown extraction logic from the audio.py file in addition to a utils function for grabbing
env variables related to inputs for the ffmpeg recording.
'''

# Function to run the main walkthrough section
def guideframe_script():
# Main walkthrough logic here divided into steps etc (will hopefully be more legible after future refactors)
#----------------------------------------------------------------------------------------------------------------------------------------------------------------------
try:
'''
Setup - Setup driver and Open Tutors.dev and set window size etc
Expand All @@ -29,7 +20,7 @@ def guideframe_script():
'''
guide_step(
1,
lambda: None
lambda: None,
)

'''
Expand All @@ -38,16 +29,18 @@ def guideframe_script():
guide_step(
2,
lambda: click_element(driver, "span.ml-2.hidden.text-sm.font-bold.md\\:block"),
lambda: sleep_for(0.5),
lambda: click_element(driver, "label[data-testid='segment-item']"),
lambda: click_element(driver, "span.ml-2.hidden.text-sm.font-bold.md\\:block")
lambda: sleep_for(0.5),
lambda: click_element(driver, "span.ml-2.hidden.text-sm.font-bold.md\\:block"),
)

'''
Step 3 - navigating to the docs page
'''
guide_step(
3,
lambda: hover_and_click(driver, "/course/tutors-reference-manual")
lambda: hover_and_click(driver, "/course/tutors-reference-manual"),
)

'''
Expand Down Expand Up @@ -96,22 +89,44 @@ def guideframe_script():
)

'''
Step 9 - Retuning to the original card
Step 9 - Click the search button
'''
guide_step(
9,
lambda: scroll_to_element(driver, "/note/tutors-reference-manual/unit-0-getting-started/note-01-getting-started"),
lambda: hover_and_click(driver, "/note/tutors-reference-manual/unit-0-getting-started/note-01-getting-started")
lambda: click_element_by_xpath(driver, '/html/body/div[1]/div[1]/header/header/section/div[3]/div[1]/div[3]/button/div/span[2]'),
)

'''
Step 10 - Search for a term
'''
guide_step(
10,
lambda: type_into_field(driver, "search", "card"),
)

'''
Step 11 - Open the search result in a new tab
'''
guide_step(
11,
lambda: open_link_in_new_tab(driver, "https://tutors.dev/note/tutors-reference-manual/unit-1-fundamentals/note-02-cards")
)

'''
Step 12 - End demo
'''
guide_step(
12,
lambda: None
)


finally:
print("Script complete -> moving to assembly")
driver.quit()

# End of walkthrough section
#----------------------------------------------------------------------------------------------------------------------------------------------------------------------

# Main function to run the test and assemble the clips (now passing the number of steps to the assembly function)
# Main function to run the test and assemble the clips
if __name__ == "__main__":
guideframe_script()
assemble(9)
assemble(12)
26 changes: 0 additions & 26 deletions tutors_test.md

This file was deleted.