Skip to content

Commit

Permalink
Fix Chrome tests getting stuck and remove broken report generation (#404
Browse files Browse the repository at this point in the history
)

* test

* test

* test

* Have chrome ignore iframe tests for now

* missed a line

* test

* lower timeout

* lets try to streamline this whole thing

* cleanup

* try older upload and download artifact version

* remove report generation
  • Loading branch information
Wolfe1 committed May 22, 2024
1 parent 2ca613a commit 885922b
Show file tree
Hide file tree
Showing 6 changed files with 168 additions and 144 deletions.
63 changes: 6 additions & 57 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
python-version: [ 3.8, 3.9, '3.10', '3.11' , '3.12']
python-version: [ 3.8, 3.9, '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -30,23 +30,15 @@ jobs:
- name: Run Edge Robot Tests
uses: nick-fields/retry@v3.0.0
with:
timeout_minutes: 45
timeout_minutes: 10
max_attempts: 10
command: robot -i Edge --output reports/outputEdge.xml test
new_command_on_retry: sleep 30; robot --rerunfailed "reports/outputEdge.xml" -i Edge --output reports/outputEdge.xml test

- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: reportsEdge${{ matrix.python-version }}
path: reports

run-tests-chrome:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.8, 3.9, '3.10', '3.11' , '3.12']
python-version: [ 3.8, 3.9, '3.10', '3.11', '3.12']
include:
- os: ubuntu-latest
set_display: export DISPLAY=:99; Xvfb :99 -screen 0 1024x768x24 -ac -noreset & sleep 3
Expand All @@ -68,27 +60,17 @@ jobs:
- name: Run Chrome Robot Tests
uses: nick-fields/retry@v3.0.0
with:
timeout_minutes: 45
timeout_minutes: 10
max_attempts: 10
command: |
${{ matrix.set_display }}
robot --randomize suites -e BrokenORWindowsOREdge --output reports/outputChrome.xml test
new_command_on_retry: |
${{ matrix.set_display }}
robot --rerunfailed "reports/outputChrome.xml" -e BrokenORWindowsOREdge --output reports/outputChrome.xml test
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: reportsChrome${{ matrix.python-version }}
path: reports
robot -e BrokenORWindowsOREdge --output reports/outputChrome.xml test
run-tests-unit:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.8, 3.9, '3.10', '3.11' , '3.12']
python-version: [ 3.8, 3.9, '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -114,36 +96,3 @@ jobs:
parallel: true
run: |
coveralls --service=github
generate_report:
permissions:
actions: write
issues: write
discussions: write
pull-requests: write
if: always()
needs: [run-tests-chrome, run-tests-edge]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download reportsChrome
uses: actions/download-artifact@v4
with:
name: reportsChrome
path: reports
- name: Download reportsEdge
uses: actions/download-artifact@v4
with:
name: reportsEdge
path: reports
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install robotframework
- name: combine reports
run: rebot -o reports/output.xml reports/*.xml
- name: Send report to commit
uses: joonvena/robotframework-reporter-action@v2.4
with:
gh_access_token: ${{ secrets.GITHUB_TOKEN }}
show_passed_tests: false
51 changes: 36 additions & 15 deletions docs/APILibraryDocumentation.html

Large diffs are not rendered by default.

51 changes: 36 additions & 15 deletions docs/GUILibraryDocumentation.html

Large diffs are not rendered by default.

51 changes: 36 additions & 15 deletions docs/SOAPLibraryDocumentation.html

Large diffs are not rendered by default.

92 changes: 52 additions & 40 deletions test/GUI/GUITests.robot
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
Documentation Zoomba GUI Library Tests
Library ../../src/Zoomba/GUILibrary.py
Library Collections
Test Teardown Close All Browsers
Suite Setup Test Case Setup
Suite Teardown Close All Browsers
Test Tags Chrome


*** Variables ***
${browser} chrome
${GITHUB_SEARCH} //input[@id='query-builder-test']
${GITHUB_SEARCH_URL} https://github.com/search
${GITHUB_SEARCH} //input[@aria-label="Search GitHub"]
${GITHUB_README} //span[contains(text(),'README')]
${RF_LINK} //a[@href='/robotframework/robotframework']
${ALT_URL1} http://www.google.com
Expand All @@ -17,60 +19,64 @@ ${CHECK_DIV} //div[@id='res']

*** Test Cases ***
Wait For Keywords Test
Test Case Setup
Press Keys ${None} /
Go To ${GITHUB_SEARCH_URL}
Wait Until Javascript Is Complete
Wait For And Input Text ${GITHUB_SEARCH} robotframework
Press Keys ${GITHUB_SEARCH} RETURN
Wait For And Click Element ${RF_LINK}
Wait Until Page Contains Element ${GITHUB_README}

Wait For Keywords Test With Password
Test Case Setup
Press Keys ${None} /
Wait For And Input Password ${GITHUB_SEARCH} robotframework
Go To ${GITHUB_SEARCH_URL}
Wait Until Javascript Is Complete
Wait For And Input Text ${GITHUB_SEARCH} robotframework
Press Keys ${GITHUB_SEARCH} RETURN
Wait For And Click Element ${RF_LINK}
Wait Until Page Contains Element ${GITHUB_README}

Element Value Should Be Equal And Not Equal Test
Test Case Setup ${ALT_URL1}
Go To ${ALT_URL1}
Wait For Page To Load
Element Value Should Be Equal btnK Google Search
Element Value Should Not Be Equal btnK Not Google Search

Save Selenium Screenshot Test
Test Case Setup ${ALT_URL1}
Go To ${ALT_URL1}
${file1} Save Selenium Screenshot
${file2} Save Selenium Screenshot
Should Not Be Equal ${file1} ${file2}
Should Match Regexp ${file1} .selenium-screenshot-\\d{10}.\\d{0,8}-\\d.png

Iframe Keywords Test
Set Test Variable ${CHECK_ELEMENT} //a[@href='default.asp'][@class='active']
Test Case Setup https://www.w3schools.com/html/html_iframe.asp
Page Should Not Contain Element ${CHECK_ELEMENT}
Wait For And Select Frame //iframe[@src='default.asp']
Wait Until Page Contains Element ${CHECK_ELEMENT}
Go To https://seleniumbase.io/w3schools/iframes
Wait For Page To Load
Page Should Not Contain This page is displayed in an iframe
Wait For And Select Frame //iframe[@id='iframeResult']
Unselect Frame
Page Should Not Contain Element ${CHECK_ELEMENT}
Page Should Not Contain This page is displayed in an iframe

Nested Iframe Keyword Test
Test Case Setup https://www.quackit.com/html/tags/html_iframe_tag.cfm
Go To https://www.quackit.com/html/tags/html_iframe_tag.cfm
Wait For Page To Load
Select Nested Frame //iframe[@name='result4'] //iframe[@src='/html/tags/html_iframe_tag_example.cfm']

Mouse Over Keywords Test
Test Case Setup https://jquery.com/
Go To https://jquery.com/
Wait For Page To Load
Wait For And Mouse Over //a[contains(text(),'Download')]
Wait For And Mouse Over And Click //a[contains(text(),'Browser Support')]
Wait Until Page Contains Current Active Support

Wait Until Javascript Completes Test
Test Case Setup https://jquery.com/
Go To https://jquery.com/
Wait For Page To Load
Wait Until Page Contains Element //a[@title='jQuery']
Wait Until Javascript Is Complete
Title Should Be jQuery

Web Elements Text Test
Test Case Setup ${ALT_URL1}
Go To ${ALT_URL1}
Wait For Page To Load
Wait For And Input Text ${TEXT_AREA} robot framework
Press Keys ${TEXT_AREA} RETURN
Wait Until Element Is Visible ${CHECK_DIV}
Expand All @@ -79,13 +85,14 @@ Web Elements Text Test
Should Contain ${linksTextList}[0] Robot Framework

Web Elements Vertical Position Test
Test Case Setup ${ALT_URL1}
Go To ${ALT_URL1}
Wait For Page To Load
Wait For And Input Text ${TEXT_AREA} robot framework
Press Keys ${TEXT_AREA} RETURN
Wait Until Element Is Visible ${CHECK_DIV}
${resultsLinksList} Get Webelements ${CHECK_DIV}
${linksPositionList} Get Vertical Position From Web Elements List ${resultsLinksList}
Should Be True ${linksPositionList}[0] > ${170}
Should Be True ${linksPositionList}[0] > ${160}

Create Dictionary From Lists Test
${testDict1} Create Dictionary Name=User1 ID=01 Phone=51212345678
Expand All @@ -108,7 +115,8 @@ Truncate String Test
Should Be Equal ${reallyLongTestString} ${actualTruncatedString2}

Scroll To Bottom Of Page Test
Test Case Setup ${ALT_URL1}
Go To ${ALT_URL1}
Wait For Page To Load
Wait For And Input Text ${TEXT_AREA} robot framework
Press Keys ${TEXT_AREA} RETURN
Wait Until Element Is Visible ${CHECK_DIV}
Expand All @@ -117,28 +125,33 @@ Scroll To Bottom Of Page Test
Should Be True ${position} > 700

Wait Until Window Tests
Test Case Setup https://www.quackit.com/html/codes/html_popup_window_code.cfm
Go To https://www.quackit.com/html/codes/html_popup_window_code.cfm
Wait For Page To Load
Wait For And Select Frame //iframe[@name='result1']
Click Element //a[contains(text(),'Open a popup window')]
Wait For And Click Element //a[contains(text(),'Open a popup window')]
Wait Until Window Opens Popup Example 10
Wait For And Select Window Popup Example 10

Wait Until Element Contains Value
Test Case Setup ${ALT_URL1}
Input Text ${TEXT_AREA} abc123
Go To ${ALT_URL1}
Wait For Page To Load
Wait For And Input Text ${TEXT_AREA} abc123
Wait Until Element Contains Value ${TEXT_AREA} abc123

Get Element CSS Attribute Value
Test Case Setup https://www.w3schools.com/html/html_examples.asp
Go To https://www.w3schools.com/html/html_examples.asp
Wait For Page To Load
${value} Get Element CSS Attribute Value //div[@id='googleSearch'] display
Should Be Equal ${value} block

Element CSS Attribute Value Should Be
Test Case Setup https://www.w3schools.com/html/html_examples.asp
Go To https://www.w3schools.com/html/html_examples.asp
Wait For Page To Load
Element CSS Attribute Value Should Be //div[@id='googleSearch'] display block

Get React List Items Test
[Setup] Test Case Setup https://react-select.com/home
Go To https://react-select.com/home
Wait For Page To Load
${selectXpath} Set Variable //*[@id="root"]/div/div[2]/div[2]/div/div/div[1]/div[2]
${expectedLabels} Create List Ocean Blue Purple Red Orange Yellow Green Forest Slate Silver
Wait Until Page Contains Element ${selectXpath}
Expand All @@ -147,24 +160,23 @@ Get React List Items Test
Lists Should Be Equal ${expectedLabels} ${actualLabels} ignore_order=True

Test Mouse Scroll
[Setup] Test Case Setup https://www.bgc.bard.edu/research-forum/articles/292/test-zoom-function-on-object
Set Test Variable ${MOUSE_SCROLL_CHECK} //body/div[6]/div[1]/div[1]/div[1]/div[2]/div[1]/div[5]/div[1]/div[1]
Set Selenium Speed 1s
Go To https://www.bgc.bard.edu/research-forum/articles/292/test-zoom-function-on-object
Wait For Page To Load
Set Test Variable ${MOUSE_SCROLL_CHECK} //body/div[6]/div[1]/div[1]/div[1]/div[2]/div[1]/div[5]/div[1]/div[1]
Scroll Element Into View ${MOUSE_SCROLL_CHECK}
Mouse Scroll Over Element ${MOUSE_SCROLL_CHECK} y=-100
Mouse Scroll y=200

Test Disabled Elements
[Setup] Test Case Setup https://demos.jquerymobile.com/1.4.5/forms-disabled
Set Test Variable ${LIST_CHECK} //select[@id='select-native-5']
${list_selection} Get Selected List Label ${LIST_CHECK}
List Selection Should Be ${LIST_CHECK} ${list_selection}
Go To https://demos.jquerymobile.com/1.4.5/forms-disabled
Wait For Page To Load
${list_selection} Get Selected List Label //select[@id='select-native-5']
List Selection Should Be //select[@id='select-native-5'] ${list_selection}


*** Keywords ***
Test Case Setup
[Arguments] ${url}=https://github.com/ ${browser}=${browser}
Open Browser ${url} browser=${browser}
Open Browser browser=Chrome
Maximize Browser Window
Wait For Page To Load
Set Selenium Speed 0.05s
Set Selenium Speed 0.05s
4 changes: 2 additions & 2 deletions test/GUI/GUITestsEdge.robot
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Web Elements Vertical Position Test
Wait Until Element Is Visible ${CHECK_DIV}
${resultsLinksList} Get Webelements ${CHECK_DIV}
${linksPositionList} Get Vertical Position From Web Elements List ${resultsLinksList}
Should Be True ${linksPositionList}[0] > ${170}
Should Be True ${linksPositionList}[0] > ${160}

Create Dictionary From Lists Test
${testDict1} Create Dictionary Name=User1 ID=01 Phone=51212345678
Expand Down Expand Up @@ -128,7 +128,7 @@ Wait Until Window Tests
Go To https://www.quackit.com/html/codes/html_popup_window_code.cfm
Wait For Page To Load
Wait For And Select Frame //iframe[@name='result1']
Click Element //a[contains(text(),'Open a popup window')]
Wait For And Click Element //a[contains(text(),'Open a popup window')]
Wait Until Window Opens Popup Example 10
Wait For And Select Window Popup Example 10

Expand Down

0 comments on commit 885922b

Please sign in to comment.