Skip to content

Commit 288f89a

Browse files
authored
Merge pull request #44 from chipspeak/GUIDEFRAME-57
task(GUIDEFRAME-57): update code walkthrough
2 parents 60650f1 + 791d504 commit 288f89a

File tree

3 files changed

+40
-12
lines changed

3 files changed

+40
-12
lines changed

.DS_Store

2 KB
Binary file not shown.

guideframe_demos/guideframe_code_demo/guideframe_code_demo.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ All the python script requires is the relevant imports as seen at the top of the
1414
Let's examine steps 1 and 2 to illustrate the syntax of a GuideFrame step. Each step takes a number as an argument in addition to a lambda function and an opptional argument for the order of the voicever relative to the interactions. In the case of step 1, lambda is set to none in order to hang on the main webpage while the voiceover is performed. Step 2 features a call to the click button by span text function to click the agree button.
1515

1616
## Step 6
17-
Lets skip to step 14 to demonstrate the ability to pass multiple actions. In this case, we're filling review fields on the test site. A user can pass as many actions to a step as they wish and GuideFrame will iterate them.
17+
Lets skip to step 14 to demonstrate the ability to pass multiple actions. In this case, we're filling review fields on the test site. A user can pass as many actions to a step as they wish and GuideFrame will iterate through them.
1818

1919
## Step 7
20-
Once a user has defined all of their guide steps within a function, they can simply call this function within main. The user should then pass the number of steps to the assemble function from the GuideFrame library. This function carries out the assembly of all generated audio and video segments. Now that we've got a high level understanding of GuideFrame, let's take a look at the underlying code.
20+
Once a user has defined all of their guide steps within a function, they should call it within main. They should then pass the number of steps to the assemble function. This function carries out the assembly of all generated audio and video segments. Now that we've got a high level understanding of GuideFrame, let's take a look at the underlying code.
2121

2222
## Step 8
23-
Let's start off by examining one of the selenium functions. The selenium file acts as an SDK which allows user's to more easily create individual interactions. There are numerous actions available but for this demonstration we'll use a small subset. The first one we'll look at is the open link in new tab function. Like many of these functions, its wrapped in a try block with exception handling. This ensures any failures propagate up to the GitHub action. The function takes the webdriver and a h ref as an argument. The h ref is then passed to selenium's native functions. It opens the link and then switches to the most recently opened tab.
23+
Let's start off by examining one of the selenium functions. The selenium file acts as an SDK which allows users to more easily create individual interactions. There are numerous actions available but for this demonstration we'll use a small subset. The first one we'll look at is the open link in new tab function. Like most of these functions, its wrapped in a try block with exception handling. The function takes the webdriver and a h ref as an argument. The h ref is then passed to selenium's native functions. It opens the link and then switches to the most recently opened tab.
2424

2525
## Step 9
2626
Lets demonstrate it by using the magento test site. We'll use the function to open the test site in a new tab and switch to it.
@@ -44,7 +44,7 @@ The final function we'll examine allows a user to hover over elements. This func
4444
When defining this particular step, we also pass sleep functions to allow space between selections.
4545

4646
## Step 16
47-
Now that we've demonstrated some of the functions, lets dive a little deeper into the core logic that makes this possible. The utils file contains much of the logic relating to the guide steps themselves. The function seen here uses script arguments to assign appropriate variables.
47+
Now that we've demonstrated some of the functions, lets dive a little deeper into the code that makes this possible. The utils file contains much of the logic relating to the guide steps themselves. The function seen here uses script arguments to extract environment variables.
4848

4949
## Step 17
5050
This pair of functions simply serve to extract the scripts name for use in additional logic.
@@ -71,16 +71,22 @@ The assemble function takes the steps number and uses it to loop through all of
7171
Finally, a cleanup loop removes all of the files generated through this process.
7272

7373
## Step 25
74-
The final layer of guideframe is its use as a git hub action. This allows users to run guideframe on repository updates in order to ensure new render on changes. This removes the need for local rendering by an engineer. It also ensures that breaking changes to guideframe or the product it demos are easily caught.
74+
The final layer of guideframe is its use as a git hub action. This allows users to run guideframe on repository updates.
7575

7676
## Step 26
77-
This render workflow activates on push events. It spins up an ubuntu git hub runner and installs the requirements needed to run guideframe. The pip install commands here don't install the guideframe package. This is because this workflow runs within the source repository. Within the template repository, these python installations are replaced with pip install guideframe.
77+
This render workflow activates on push events. It spins up an ubuntu git hub runner and installs the requirements needed to run guideframe. Note the pip install commands here don't install the guideframe package. This is because this workflow runs within the source repository. Within the template repository, these python installations are replaced with pip install guideframe.
7878

7979
## Step 27
80-
Once the environment is set up, the virtual display is started. The tutors test is then run before a final step uploads this output as an artifact. This allows the user to download the final mp4 from the workflow. This then completes the full GuideFrame pipeline.
80+
Once the environment is set up, the virtual display is started. The tutors demo is then run before a final step uploads this output as an artifact. This allows the user to download the final mp4 from the workflow.
8181

8282
## Step 28
83-
This concludes the walkthrough. Be sure to check out the project on GitHub or PyPy.
83+
This concludes the code walkthrough. GuideFrame is available on GitHub via the link seen here.
84+
85+
## Step 29
86+
It can also be found here on PyPi.
87+
88+
## Step 30
89+
And finally, the official documentation can be found here. Thanks for watching!
8490

8591

8692

guideframe_demos/guideframe_code_demo/guideframe_code_demo.py

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
def guideframe_script():
77
try:
88
'''
9-
Setup - Setup driver and Open Tutors.dev and set window size etc
9+
Setup - Setup driver, Open GuideFrame repo and set window size etc
1010
'''
1111
env_settings = get_env_settings() # Getting the environment settings
1212
driver_location = env_settings["driver_location"] # Getting the driver location from the settings
@@ -286,15 +286,37 @@ def guideframe_script():
286286
order="action-before-vo"
287287
)
288288

289+
#-------------------Conclusion-------------------#
290+
289291
'''
290-
Step 28 - End of script
292+
Step 28 - GitHub page
291293
'''
292294
guide_step(
293295
28,
296+
lambda: open_url(driver, "https://github.com/chipspeak/GuideFrame"),
297+
order="action-before-vo"
298+
)
299+
300+
'''
301+
Step 29 - PyPi page
302+
'''
303+
guide_step(
304+
29,
294305
lambda: open_url(driver, "https://pypi.org/project/guideframe/"),
295306
order="action-before-vo"
296307
)
297-
308+
309+
'''
310+
Step 30 - Docs page
311+
'''
312+
guide_step(
313+
30,
314+
lambda: open_url(driver, "https://chipspeak.github.io/GuideFrame/"),
315+
order="action-before-vo"
316+
)
317+
318+
#-------------------Walkthrough Complete-------------------#
319+
298320
finally:
299321
print("Script complete -> moving to assembly")
300322
driver.quit()
@@ -303,4 +325,4 @@ def guideframe_script():
303325
# Main function to run the test and assemble the clips (now passing the number of steps to the assembly function)
304326
if __name__ == "__main__":
305327
guideframe_script()
306-
assemble(28)
328+
assemble(30)

0 commit comments

Comments
 (0)