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.
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
.venv
*.mp4
*.mp3
*.tar.gz
*.whl
tts_audio
lib
bin
include
__pycache__
.vscode
__pycache__/
.vscode/
6 changes: 0 additions & 6 deletions .vscode/settings.json

This file was deleted.

10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# GuideFrame

A walkthrough video generation tool created for the final project module on the HDip in Computer Science SETU

## Installation

GuideFrame is packaged and available on pypi. It can be installed using:

```pip install guideframe```

Once installed, you will need to install the non-python dependencies. A setup script is packaged with GuideFrame for this. You can simply copy it from the GuideFrame repo and run it locally or you can run the following:

```bash $(python -c "import guideframe, os; print(os.path.join(os.path.dirname(guideframe.__file__), 'setup_env.sh'))")```
Binary file removed __pycache__/assembly.cpython-313.pyc
Binary file not shown.
Binary file removed __pycache__/audio.cpython-313.pyc
Binary file not shown.
Binary file removed __pycache__/video.cpython-313.pyc
Binary file not shown.
5 changes: 5 additions & 0 deletions guideframe/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from . import assembly
from . import audio
from . import selenium
from . import utils
from . import video
2 changes: 1 addition & 1 deletion guideframe_assembly.py → guideframe/assembly.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ffmpeg
import os
import uuid
from guideframe_utils import extract_script_name
from guideframe.utils import extract_script_name

'''
The assembly.py file contains the functions to combine the audio and video files into a single video file
Expand Down
File renamed without changes.
16 changes: 16 additions & 0 deletions guideframe/scripts/install_dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -e # Exit immediately if a command exits with a non-zero status
set -x # Print each command before executing it (for debugging)

# Update package list
sudo apt-get update

# Install system dependencies
sudo apt-get install -y \
ffmpeg \
xvfb \
chromium-driver \
chromium-browser

echo "Guideframe setup completed successfully!"
File renamed without changes.
4 changes: 2 additions & 2 deletions guideframe_utils.py → guideframe/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from guideframe_audio import generate_voicover
from guideframe_video import start_ffmpeg_recording, stop_ffmpeg_recording
from guideframe.audio import generate_voicover
from guideframe.video import start_ffmpeg_recording, stop_ffmpeg_recording
import time
import sys

Expand Down
File renamed without changes.
25 changes: 25 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[project]
name = "guideframe"
version = "0.5.0"
description = "A tool to generate reusable software walkthrough videos via code."
authors = [
{name = "Pat O'Connor"}
]
license = {text = "MIT"}
readme = "README.md"
requires-python = ">=3.11"
dependencies = [
"selenium (==4.27.1)",
"ffmpeg-python (==0.2.0)",
"mutagen (==1.47.0)",
"gtts (==2.5.4)"
]


[build-system]
requires = ["poetry-core>=2.0.0,<3.0.0"]
build-backend = "poetry.core.masonry.api"


[tool.poetry]
include = ["guideframe/scripts/install_dependencies.sh"]
24 changes: 15 additions & 9 deletions selenium_demos/selenium_automation_tests.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from guideframe_selenium import *
from guideframe_utils import get_env_settings # Importing the guide_step and get_env_settings functions from guideframe_utils.py
from guideframe.selenium import *
from guideframe.utils import get_env_settings # Importing the guide_step and get_env_settings functions from guideframe_utils.py
import time

# Setup the driver and perform automation tests
Expand All @@ -13,9 +13,13 @@ def selenium_automation_tests():
# Set window size and navigate to URL
set_window_size(driver)
open_url(driver, "https://magento.softwaretestingboard.com/")

# Clicking the agree button for the privacy policy
time.sleep(2)

'''
# Removing this as cookie is not present in github runner environment
click_button_by_span_text(driver, "AGREE")
time.sleep(2)
'''

# Click on the 'Sign In' link
click_element(driver, ".authorization-link > a")
Expand Down Expand Up @@ -74,17 +78,19 @@ def selenium_automation_tests():
# Click the "Sign Out" button
click_element(driver, "a[href='https://magento.softwaretestingboard.com/customer/account/logout/']")
time.sleep(2)

# Print the success message
print("Test Passed ✅")
print("Test Passed ✅") # Print the success message
exit_code = 0 # Set the exit code to 0

except Exception as e:
# print the failure message
print(f"Test Failed ❌: {str(e)}")

exit_code = 1 # Set the exit code to 1
raise

finally:
# Close the browser
driver.quit()
exit(exit_code)

# Run the automation test
if __name__ == "__main__":
Expand Down
6 changes: 3 additions & 3 deletions selenium_demos/selenium_function_demo.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from guideframe_selenium import * # Importing all functions from selenium_functions.py
from guideframe_assembly import assemble # Importing the assemble_clips function from assembly.py
from guideframe_utils import get_env_settings, guide_step # Importing the guide_step and get_env_settings functions from guideframe_utils.py
from guideframe.selenium import * # Importing all functions from selenium_functions.py
from guideframe.assembly import assemble # Importing the assemble_clips function from assembly.py
from guideframe.utils import get_env_settings, guide_step # Importing the guide_step and get_env_settings functions from guideframe_utils.py


# This function will run the full script
Expand Down
6 changes: 3 additions & 3 deletions tutors_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from guideframe_selenium import * # Moved all selenium functions to external file
from guideframe_assembly import assemble # Importing the assemble_clips function from assembly.py
from guideframe_utils import guide_step, get_env_settings # Importing the guide_step and get_env_settings functions from guideframe_utils.py
from guideframe.selenium import * # Moved all selenium functions to external file
from guideframe.assembly import assemble # Importing the assemble_clips function from assembly.py
from guideframe.utils import guide_step, get_env_settings # Importing the guide_step and get_env_settings functions from guideframe_utils.py


'''
Expand Down