Skip to content

Commit 3e49c65

Browse files
authored
Merge pull request #42 from chipspeak/GUIDEFRAME-55
task(GUIDEFRAME-55): updated tutors demo
2 parents 75bef47 + 8483755 commit 3e49c65

File tree

5 files changed

+73
-49
lines changed

5 files changed

+73
-49
lines changed

.DS_Store

4 KB
Binary file not shown.

.github/workflows/render.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: GuideFrame Video Render
33
on: [push]
44
# All jobs in the workflow
55
jobs:
6-
tutors-test:
6+
render-tutors-demo:
77
runs-on: ubuntu-latest
88
# steps to run
99
steps:
@@ -31,10 +31,10 @@ jobs:
3131
nohup Xvfb :99 -screen 0 1920x1080x24 &
3232
3333
# Run the Python script
34-
python3 tutors_test.py github
34+
python3 guideframe_tutors_demo.py github
3535
# Upload the screen recording as an artifact
3636
- name: Upload screen recording as artifact
3737
uses: actions/upload-artifact@v4
3838
with:
39-
name: tutors-test
40-
path: ./tutors_test*.mp4
39+
name: render-tutors-demo
40+
path: ./guideframe_tutors_demo*.mp4

guideframe_tutors_demo.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
## Step 1
2+
This brief GuideFrame demo begins by opening tutors.dev. This is achieved by using the open u r l function prior to step 1.
3+
4+
## Step 2
5+
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.
6+
7+
## Step 3
8+
Now let's use the hover and click function to move to the tutors reference manual.
9+
10+
## Step 4
11+
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.
12+
13+
## Step 5
14+
We'll start with the getting started card.
15+
16+
## Step 6
17+
Now let's move on to the simple starter card.
18+
19+
## Step 7
20+
Let's continue to the alternative starter card. Before using the scroll to element function to move to the reference course.
21+
22+
## Step 8
23+
In this case, we use this function to access an element that isn't in the display window.
24+
25+
## Step 9
26+
Let's use the click element by xpath function. We'll use it to access the search bar at the top of the screen.
27+
28+
## Step 10
29+
With the search bar open, let's use the type into field function to type in card.
30+
31+
## Step 11
32+
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.
33+
34+
## Step 12
35+
And that concludes this GuideFrame demonstration.

tutors_test.py renamed to guideframe_tutors_demo.py

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,8 @@
33
from guideframe.utils import guide_step, get_env_settings # Importing the guide_step and get_env_settings functions from guideframe_utils.py
44

55

6-
'''
7-
As of GUIDEFRAME-31 as much logic as possible has been moved to external files to aid legibility
8-
and promote the ability to have easily create a new test without having to adjust the GuideFrame logic itself.
9-
This version also features the markdown extraction logic from the audio.py file in addition to a utils function for grabbing
10-
env variables related to inputs for the ffmpeg recording.
11-
'''
12-
136
# Function to run the main walkthrough section
147
def guideframe_script():
15-
# Main walkthrough logic here divided into steps etc (will hopefully be more legible after future refactors)
16-
#----------------------------------------------------------------------------------------------------------------------------------------------------------------------
178
try:
189
'''
1910
Setup - Setup driver and Open Tutors.dev and set window size etc
@@ -29,7 +20,7 @@ def guideframe_script():
2920
'''
3021
guide_step(
3122
1,
32-
lambda: None
23+
lambda: None,
3324
)
3425

3526
'''
@@ -38,16 +29,18 @@ def guideframe_script():
3829
guide_step(
3930
2,
4031
lambda: click_element(driver, "span.ml-2.hidden.text-sm.font-bold.md\\:block"),
32+
lambda: sleep_for(0.5),
4133
lambda: click_element(driver, "label[data-testid='segment-item']"),
42-
lambda: click_element(driver, "span.ml-2.hidden.text-sm.font-bold.md\\:block")
34+
lambda: sleep_for(0.5),
35+
lambda: click_element(driver, "span.ml-2.hidden.text-sm.font-bold.md\\:block"),
4336
)
4437

4538
'''
4639
Step 3 - navigating to the docs page
4740
'''
4841
guide_step(
4942
3,
50-
lambda: hover_and_click(driver, "/course/tutors-reference-manual")
43+
lambda: hover_and_click(driver, "/course/tutors-reference-manual"),
5144
)
5245

5346
'''
@@ -96,22 +89,44 @@ def guideframe_script():
9689
)
9790

9891
'''
99-
Step 9 - Retuning to the original card
92+
Step 9 - Click the search button
10093
'''
10194
guide_step(
10295
9,
103-
lambda: scroll_to_element(driver, "/note/tutors-reference-manual/unit-0-getting-started/note-01-getting-started"),
104-
lambda: hover_and_click(driver, "/note/tutors-reference-manual/unit-0-getting-started/note-01-getting-started")
96+
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]'),
10597
)
98+
99+
'''
100+
Step 10 - Search for a term
101+
'''
102+
guide_step(
103+
10,
104+
lambda: type_into_field(driver, "search", "card"),
105+
)
106+
107+
'''
108+
Step 11 - Open the search result in a new tab
109+
'''
110+
guide_step(
111+
11,
112+
lambda: open_link_in_new_tab(driver, "https://tutors.dev/note/tutors-reference-manual/unit-1-fundamentals/note-02-cards")
113+
)
114+
115+
'''
116+
Step 12 - End demo
117+
'''
118+
guide_step(
119+
12,
120+
lambda: None
121+
)
122+
106123

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

111-
# End of walkthrough section
112-
#----------------------------------------------------------------------------------------------------------------------------------------------------------------------
113128

114-
# Main function to run the test and assemble the clips (now passing the number of steps to the assembly function)
129+
# Main function to run the test and assemble the clips
115130
if __name__ == "__main__":
116131
guideframe_script()
117-
assemble(9)
132+
assemble(12)

tutors_test.md

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

0 commit comments

Comments
 (0)