Skip to content

Commit

Permalink
all_Automation_Git_Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
AmolKadam-Tekdi committed Jul 16, 2024
1 parent d589dbd commit cdbd99f
Show file tree
Hide file tree
Showing 15 changed files with 107 additions and 48 deletions.
58 changes: 51 additions & 7 deletions allAutomation/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified allAutomation/Manifest.zip
Binary file not shown.
Binary file added allAutomation/Manifest/Icon128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added allAutomation/Manifest/Icon16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added allAutomation/Manifest/Icon48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added allAutomation/Manifest/Images/Icon128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added allAutomation/Manifest/Images/Icon16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added allAutomation/Manifest/Images/Icon48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 27 additions & 21 deletions allAutomation/Manifest/manifest.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
{
"manifest_version": 3,
"name": "My Microphone Simulator",
"version": "1.0",
"description": "Simulates microphone input for automated testing.",
"permissions": [
"tabs",
"activeTab",
"storage",
"scripting"
],
"background": {
"service_worker": "background.js"
},
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["content.js"]
"manifest_version": 2,
"name": "Microphone Simulation",
"version": "1.0",
"description": "Extension to simulate microphone input",
"permissions": [
"tabs",
"activeTab",
"https://*/*",
"http://*/*"
],
"background": {
"scripts": ["background.js"],
"persistent": false
},
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["content.js"]
}
],
"browser_action": {
"default_popup": "popup.html",
"default_icon": {
"16": "icon16.png",
"48": "icon48.png",
"128": "icon128.png"
}
}
],
"action": {
"default_popup": "popup.html"
}
}
15 changes: 12 additions & 3 deletions allAutomation/my_project/tests/BrowserManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@ def setup():
chrome_options.add_argument("--use-file-for-fake-audio-capture")
chrome_options.add_argument("--use-fake-ui-for-media-stream")
chrome_options.add_argument("--use-file-for-fake-audio-capture=output_audio.wav")

extension_path = os.path.abspath("Manifest.zip")
chrome_options.add_extension(extension_path)
# extension_Path = "E:/ALL_Automation_Git_Actions/all-learner-ai-app/allAutomation/my_project/tests/Manifest.zip"
#
# if os.path.exists(extension_Path):
# chrome_options.add_argument(f"--load-extension={extension_Path}")
# else:
# raise FileNotFoundError(f"Extension directory not found at {extension_Path}")

# Initialize Chrome WebDriver using WebDriverManager with a specific version
service = Service(ChromeDriverManager().install())
Expand All @@ -51,3 +54,9 @@ def test_open_website(setup):

# Print the title for debugging purposes
print("Page title is:", driver.title)


if __name__ == "__main__":
extension_path = os.path.abspath("Manifest.zip")
if not os.path.exists(extension_path):
print(f"Manifest.zip not found at {extension_path}")
Binary file modified allAutomation/my_project/tests/Manifest.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
34 changes: 17 additions & 17 deletions allAutomation/my_project/tests/microphoneSimulationTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def play_audio_through_microphone(audio_file):
# Mock audio playback or skip if needed
pass
else:
audio_file_path = "my_project/tests/output_audio.wav"
audio_file_path = "output_audio.wav"

# Open the WAV file for reading binary data
with wave.open(audio_file_path, 'rb') as wf:
Expand All @@ -219,19 +219,19 @@ def play_audio_through_microphone(audio_file):
p.terminate()


def test_microphone_simulation(setup):
# Your existing test logic here
# driver = webdriver.Chrome()

# Click on the Mike button
logStep("Click on the Mike button")
mike_button = driver.find_element(By.XPATH, "//*[@class='MuiBox-root css-1l4w6pd']")
mike_button.click()

# Simulate audio input if not running on GitHub Actions
if os.getenv('GITHUB_ACTIONS') != 'true':
play_audio_through_microphone('output_audio.wav')
else:
logStep("Simulate audio input process")

# Continue with the rest of your test script
# def test_microphone_simulation(setup):
# # Your existing test logic here
# # driver = webdriver.Chrome()
#
# # Click on the Mike button
# logStep("Click on the Mike button")
# mike_button = driver.find_element(By.XPATH, "//*[@class='MuiBox-root css-1l4w6pd']")
# mike_button.click()
#
# # Simulate audio input if not running on GitHub Actions
# if os.getenv('GITHUB_ACTIONS') != 'true':
# play_audio_through_microphone('output_audio.wav')
# else:
# logStep("Simulate audio input process")
#
# # Continue with the rest of your test script

0 comments on commit cdbd99f

Please sign in to comment.