Skip to content

Support webkit and firefox browser #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 103 commits into from
Oct 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
96c1e51
init playwright
atthaboon Oct 1, 2020
9e06b30
Add playwright
atthaboon Oct 4, 2020
61a4f56
init puppeteer_browsermanagement
atthaboon Oct 4, 2020
2b41b67
Update browser management
atthaboon Oct 4, 2020
7a8153d
init get webkit context
atthaboon Oct 10, 2020
1c4c538
init playwright new page
atthaboon Oct 10, 2020
676d974
Update craete browser with alias
atthaboon Oct 11, 2020
3b1cde6
Add close browser and puppeteer
atthaboon Oct 11, 2020
7c43fca
Add support goto keyword
atthaboon Oct 11, 2020
2c96cdc
clean up
atthaboon Oct 11, 2020
c98f8c3
Fix support call async keyword
atthaboon Oct 12, 2020
6cf8d10
Create based keywords async class
atthaboon Oct 13, 2020
a538db6
Update open-close-browser demo
atthaboon Oct 13, 2020
708b501
Update base playwright page
atthaboon Oct 14, 2020
452655e
Add custom playwright page context
atthaboon Oct 15, 2020
41820e4
Add support switch window keyword
atthaboon Oct 15, 2020
bd30936
init waiting keywords
atthaboon Oct 15, 2020
4a28523
init waiting keywords for playwright and playwright page
atthaboon Oct 15, 2020
1f47d76
Update support open-close browser keyword
atthaboon Oct 16, 2020
e394a1b
Support switch library context
atthaboon Oct 16, 2020
6d7d75e
Add capture screenshot
atthaboon Oct 16, 2020
0e5c4e4
Fix switch browser context
atthaboon Oct 16, 2020
9f92678
Add ignore test
atthaboon Oct 17, 2020
e8ac2df
update git workflow support specific test browser
atthaboon Oct 17, 2020
6193c92
Install playwright
atthaboon Oct 17, 2020
2f3de95
install playwright lib
atthaboon Oct 17, 2020
24aa10a
update library
atthaboon Oct 17, 2020
3761e06
install webkit
atthaboon Oct 17, 2020
113388c
Install webkit
atthaboon Oct 17, 2020
872f221
install playwright webkit
atthaboon Oct 17, 2020
a181852
Add missing ubuntu lib
atthaboon Oct 17, 2020
87f4269
update python
atthaboon Oct 17, 2020
1649c3d
Update to version 3
atthaboon Oct 17, 2020
2c9e65c
no message
atthaboon Oct 17, 2020
aeed8b6
add recheck python version
atthaboon Oct 17, 2020
07b88bf
fix typo
atthaboon Oct 17, 2020
8d39ad5
check webkit folder
atthaboon Oct 17, 2020
b8632a5
support ubuntu webkit
atthaboon Oct 17, 2020
0d45cd6
update path
atthaboon Oct 17, 2020
15868e4
update install
atthaboon Oct 17, 2020
6af8fd1
Refactor build flow
atthaboon Oct 17, 2020
37f764c
update python version
atthaboon Oct 17, 2020
b18a6f4
update upgrade pip command
atthaboon Oct 17, 2020
5fc4b24
Update playwright version
atthaboon Oct 17, 2020
7dfe49c
revert playwright version
atthaboon Oct 17, 2020
2b3f912
test run browser
atthaboon Oct 17, 2020
a3cf8be
add missing webkit lib
atthaboon Oct 17, 2020
b7adb7c
remove running webkit browser
atthaboon Oct 17, 2020
688a230
Remove dialogs pause
atthaboon Oct 17, 2020
afb7019
Remove fix python version
atthaboon Oct 17, 2020
46f7c1b
Init support chrome playwright
atthaboon Oct 17, 2020
9525e4c
Add puppeteer page count
atthaboon Oct 18, 2020
650fa26
init puppeteer screenshot
atthaboon Oct 21, 2020
8604e2d
Add support emulator mode
atthaboon Oct 21, 2020
f323bdd
Enhance support emulator mode on playwright
atthaboon Oct 22, 2020
2fd5e6d
Add alert for puppeteer
atthaboon Oct 22, 2020
fb28a23
Add doc
atthaboon Oct 22, 2020
c7035dd
clean up doc
atthaboon Oct 22, 2020
82fb8d2
refactor build pipeline ignore specific test
atthaboon Oct 22, 2020
9c2d84d
Update condition
atthaboon Oct 22, 2020
f0a54a3
Update browser context
atthaboon Oct 22, 2020
98fbdf0
upgrade playwright to latest version
atthaboon Oct 22, 2020
e2b0175
update pyppeteer lib version
atthaboon Oct 22, 2020
cca9191
Add puppeteer dropdown
atthaboon Oct 22, 2020
3484095
Add playwright dropdown
atthaboon Oct 22, 2020
cf2e3ce
Add element enable & disable keywords
atthaboon Oct 22, 2020
b4bbfa5
Fix close playwright
atthaboon Oct 23, 2020
dd3a766
Puppeteer Element visibility checking
atthaboon Oct 23, 2020
6a39093
Add element property validation
atthaboon Oct 23, 2020
731d490
puppeteer element properties validation
atthaboon Oct 23, 2020
7fec2ff
Playwright element properties validation
atthaboon Oct 23, 2020
9bb177c
Fix browser management for puppeteer
atthaboon Oct 23, 2020
3ac9b83
Remove dialog pause
atthaboon Oct 23, 2020
96e5bc8
Puppeteer support file upload
atthaboon Oct 23, 2020
85ed9e3
Playwright file upload
atthaboon Oct 23, 2020
3b6b4b0
Puppeteer form element
atthaboon Oct 23, 2020
eb247a7
Playwright formelement keywords
atthaboon Oct 23, 2020
bba3da9
puppeteer iframe keywords
atthaboon Oct 23, 2020
5d55e11
Puppeteer iframe support
atthaboon Oct 23, 2020
3d6c544
update properties
atthaboon Oct 24, 2020
ee5c2b0
Playwright iframe
atthaboon Oct 24, 2020
dd3aa58
Add Puppeteer mouseevent keywords
atthaboon Oct 29, 2020
f27743f
Add Playwright mouse event keywords
atthaboon Oct 29, 2020
f7a4a1a
Remove ignore mouse event test case
atthaboon Oct 29, 2020
c535e65
Add Playwright asyncio keywords
atthaboon Oct 29, 2020
e836fdb
Update default test browser
atthaboon Oct 29, 2020
a1aca83
Add support javascript keywords
atthaboon Oct 29, 2020
714f694
Move all interface keywords to ikeywords folder
atthaboon Oct 29, 2020
e20b1d9
Create print as pdf
atthaboon Oct 29, 2020
d3f270d
Add log messages keywords
atthaboon Oct 30, 2020
1faeb5b
Update screenshot keywords
atthaboon Oct 30, 2020
bce8e24
Add support wait http request and response
atthaboon Oct 30, 2020
4991de0
Add Puppeteer wait keywords
atthaboon Oct 30, 2020
df4b9f9
Add wait for playwright waiting for http request
atthaboon Oct 30, 2020
043b11d
Add wait for playwright keywords
atthaboon Oct 30, 2020
0e96d51
Release playwright keywords
atthaboon Oct 30, 2020
1ec11a7
Add support timeout
atthaboon Oct 31, 2020
770ea20
Add Puppeteer mock response keywords
atthaboon Oct 31, 2020
b868943
Add playwright and puppeteer mock response keywords
atthaboon Oct 31, 2020
694169a
Cleanup scripts
atthaboon Oct 31, 2020
f99805b
Add firefox support
atthaboon Oct 31, 2020
60cb895
Cleanup scripts
atthaboon Oct 31, 2020
d2a4d6d
Clean up scripts
atthaboon Oct 31, 2020
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
49 changes: 45 additions & 4 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [3.6, 3.7, 3.8]
# python-version: [3.7, 3.8, 3.9]
include:
- python-version: 3.7
browser: webkit
- python-version: 3.8
browser: chrome
- python-version: 3.9
browser: firefox

steps:
- uses: actions/checkout@v1
Expand All @@ -21,17 +28,51 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Install webkit
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
gstreamer1.0-libav \
gstreamer1.0-plugins-bad \
libgstreamer-plugins-bad1.0-0 \
libwoff1 \
libopus0 \
libwebp6 \
libwebpdemux2 \
libenchant1c2a \
libgudev-1.0-0 \
libsecret-1-0 \
libhyphen0 \
libgdk-pixbuf2.0-0 \
libegl1 \
libnotify4 \
libxslt1.1 \
libevent-2.1-6 \
libgles2 \
libvpx5 \
libxcomposite1 \
libatk1.0-0 \
libatk-bridge2.0-0 \
libepoxy0 \
libgtk-3-0 \
libharfbuzz-icu0 \
xvfb
- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: System test
- name: Run test project
run: |
python setup.py install
pyppeteer-install
pip install -r demoapp/requirements.txt
pyppeteer-install
python -m playwright install
python demoapp/server.py &
robot -v HEADLESS:True -e Ignore Examples
- name: System test
uses: GabrielBB/xvfb-action@v1
with:
working-directory: ./ #optional
run: robot -v BROWSER:${{ matrix.browser }} -e IgnoreORIgnore_${{ matrix.browser }} Examples
14 changes: 10 additions & 4 deletions Examples/alert-handler/alert-handler.robot
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,31 @@ Test Setup Open browser to test page
Test Teardown Close All Browser
Suite Teardown Close Puppeteer


*** Variables ***
${DEFAULT_BROWSER} chrome
${HOME_PAGE_URL} http://127.0.0.1:7272/basic-html-elements.html


*** Test Cases ***
Accept alert
[Tags] Ignore_webkit Ignore_firefox
Run Async Keywords
... Handle Alert ACCEPT AND
... Click Button id=alert_confirm
... Click Element id=alert_confirm
Click Element id:get_ajax

Dismiss alert
[Tags] Ignore_webkit Ignore_firefox
Run Async Keywords
... Handle Alert DISMISS AND
... Click Button id=alert_confirm
... Click Element id=alert_confirm
Click Element id:get_ajax


*** Keywords ***
Open browser to test page
${BROWSER} = Get variable value ${BROWSER} ${DEFAULT_BROWSER}
${HEADLESS} Get variable value ${HEADLESS} ${False}
&{options} = create dictionary headless=${HEADLESS}
Open browser ${HOME_PAGE_URL} options=${options}

Open browser ${HOME_PAGE_URL} browser=${BROWSER} options=${options}
13 changes: 8 additions & 5 deletions Examples/api/mock-api.robot
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,27 @@ Test Teardown Close All Browser
Suite Teardown Close Puppeteer

*** Variables ***
${DEFAULT_BROWSER} chrome
${HOME_PAGE_URL} http://127.0.0.1:7272/basic-html-elements.html


*** Test Cases ***
Mock ajax response with raw text
Mock ajax response with raw text
&{response} Create Dictionary body=I'm a mock response text
Mock Current Page Api Response /ajax_info.json\\?count=3 ${response}
Mock Current Page Api Response /ajax_info.json?count=3 ${response}
Click Element id=get_ajax
Wait Until Page Contains I'm a mock response text

Mock ajax response with json response
&{response} Create Dictionary body={ 'data': 'I\'m a mock response json'} contentType=application/json
Mock Current Page Api Response /ajax_info.json\\?count=3 ${response}
Mock Current Page Api Response /ajax_info.json?count=3 ${response}
Click Element id=get_ajax
Wait Until Page Contains I'm a mock response json


*** Keywords ***
Open browser to test page
${HEADLESS} Get variable value ${HEADLESS} ${False}
${BROWSER} = Get variable value ${BROWSER} ${DEFAULT_BROWSER}
${HEADLESS} = Get variable value ${HEADLESS} ${False}
&{options} = create dictionary headless=${HEADLESS}
Open browser ${HOME_PAGE_URL} options=${options}
Open browser ${HOME_PAGE_URL} browser=${BROWSER} options=${options}
13 changes: 9 additions & 4 deletions Examples/browser-management/emulator-mode.robot
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@
Library PuppeteerLibrary
Suite Teardown Close Puppeteer

*** Variables ***
${DEFAULT_BROWSER} chrome
# ${DEFAULT_BROWSER} webkit

*** Test Cases ***
Example enable emulator mode
[Tags] Ignore_firefox
[Teardown] Close All Browser
${HEADLESS} Get variable value ${HEADLESS} ${False}
&{options} = create dictionary headless=${HEADLESS}
Open browser http://127.0.0.1:7272/basic-html-elements.html options=${options} alias=Browser 1
Enable emulate mode iPhone SE
${BROWSER} = Get variable value ${BROWSER} ${DEFAULT_BROWSER}
${HEADLESS} = Get variable value ${HEADLESS} ${False}
&{options} = create dictionary headless=${HEADLESS} emulate=iPhone 11
Open browser http://127.0.0.1:7272/basic-html-elements.html browser=${BROWSER} options=${options} alias=Browser 1
Capture page screenshot
21 changes: 14 additions & 7 deletions Examples/browser-management/open-close-browser.robot
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,35 @@ Library PuppeteerLibrary
Suite Teardown Close Puppeteer
Test Teardown Close All Browser

*** Variables ***
${DEFAULT_BROWSER} chrome


*** Test Cases ***
Switch to new browser
${HEADLESS} Get variable value ${HEADLESS} ${False}
${BROWSER} = Get variable value ${BROWSER} ${DEFAULT_BROWSER}
${HEADLESS} = Get variable value ${HEADLESS} ${False}
&{options} = create dictionary headless=${HEADLESS}
Open browser http://127.0.0.1:7272/basic-html-elements.html options=${options}
Open browser http://127.0.0.1:7272/basic-html-elements.html browser=${BROWSER} options=${options}
Run Async Keywords
... Wait For New Window Open AND
... Click Element id=open-new-tab
Switch Window NEW
... Click Element id=open-new-tab AND
... Wait For New Window Open
Switch Window NEW
Wait Until Page Contains Element id=exampleInputEmail1
Switch Window title=Basic HTML Elements
Wait Until Page Contains Element id=open-new-tab

Handle multiple browser
[Teardown] Capture Page Screenshot
${BROWSER} = Get variable value ${BROWSER} ${DEFAULT_BROWSER}
${HEADLESS} Get variable value ${HEADLESS} ${False}
&{options} = create dictionary headless=${HEADLESS}
Open browser http://127.0.0.1:7272/basic-html-elements.html options=${options} alias=Browser 1
Open browser http://127.0.0.1:7272/basic-html-elements.html browser=${BROWSER} options=${options} alias=Browser 1
Run Async Keywords
... Wait For New Window Open AND
... Click Element id=open-new-tab
Switch Window NEW
Open browser http://127.0.0.1:7272/basic-html-elements.html options=${options} alias=Browser 2
Open browser http://127.0.0.1:7272/basic-html-elements.html browser=${BROWSER} options=${options} alias=Browser 2
Switch Browser Browser 1
Wait Until Page Contains Login form
Switch Browser Browser 2
Expand Down
15 changes: 10 additions & 5 deletions Examples/debug-mode/enable-debug-mode.robot
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,22 @@ Library PuppeteerLibrary
Test Teardown Close All Browser
Suite Teardown Close Puppeteer

*** Variables ***
${DEFAULT_BROWSER} chrome
# ${DEFAULT_BROWSER} webkit
${HOME_PAGE_URL} http://127.0.0.1:7272/login-form-example.html


*** Test Cases ***
Enable debug mode
Open browser to test page http://127.0.0.1:7272/login-form-example.html
Open browser to test page
Input Text id=exampleInputEmail1 demo@qahive.com
Input Text id=exampleInputPassword1 123456789

*** Keywords ***
Open browser to test page
[Arguments] ${url}
${HEADLESS} Get variable value ${HEADLESS} ${False}
Run Keyword If ${HEADLESS} == ${False} Enable Debug Mode
${BROWSER} = Get variable value ${BROWSER} ${DEFAULT_BROWSER}
${HEADLESS} = Get variable value ${HEADLESS} ${False}
Run Keyword If ${HEADLESS} == ${False} Enable Debug Mode
&{options} = create dictionary headless=${HEADLESS}
Open browser ${url} options=${options}
Open browser ${HOME_PAGE_URL} browser=${BROWSER} options=${options}
5 changes: 4 additions & 1 deletion Examples/form-handler/dropdown-list.robot
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Test Teardown Close All Browser
Suite Teardown Close Puppeteer

*** Variables ***
${DEFAULT_BROWSER} chrome
# ${DEFAULT_BROWSER} webkit
${HOME_PAGE_URL} http://127.0.0.1:7272/basic-html-elements.html


Expand All @@ -23,6 +25,7 @@ Select dropdown list by labels with xpath

*** Keywords ***
Open browser to test page
${BROWSER} = Get variable value ${BROWSER} ${DEFAULT_BROWSER}
${HEADLESS} Get variable value ${HEADLESS} ${False}
&{options} = create dictionary headless=${HEADLESS}
Open browser ${HOME_PAGE_URL} options=${options}
Open browser ${HOME_PAGE_URL} browser=${BROWSER} options=${options}
10 changes: 8 additions & 2 deletions Examples/form-handler/element-properties.robot
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Test Teardown Close All Browser
Suite Teardown Close Puppeteer

*** Variables ***
${DEFAULT_BROWSER} chrome
${HOME_PAGE_URL} http://127.0.0.1:7272/basic-html-elements.html


Expand All @@ -20,7 +21,11 @@ Element is visible and not visible
Element Should Be Visible id:prop-visible
Element Should Not Be Visible id:prop-hide
Run Keyword And Expect Error REGEXP:Element 'id:prop-hide' is not be visible Element Should Be Visible id:prop-hide


Get Element Text
${text} = Get Text id=prop-text
Should Contain ${text} Please

Element should containt text
Element Should Contain id=prop-text Please ${True}

Expand All @@ -35,6 +40,7 @@ Element text should not be

*** Keywords ***
Open browser to test page
${BROWSER} = Get variable value ${BROWSER} ${DEFAULT_BROWSER}
${HEADLESS} Get variable value ${HEADLESS} ${False}
&{options} = create dictionary headless=${HEADLESS}
Open browser ${HOME_PAGE_URL} options=${options}
Open browser ${HOME_PAGE_URL} browser=${BROWSER} options=${options}
4 changes: 3 additions & 1 deletion Examples/form-handler/file-upload.robot
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Suite Teardown Close Puppeteer


*** Variables ***
${DEFAULT_BROWSER} chrome
${HOME_PAGE_URL} http://127.0.0.1:7272/basic-html-elements.html


Expand All @@ -15,6 +16,7 @@ Upload file

*** Keywords ***
Open browser to test page
${BROWSER} = Get variable value ${BROWSER} ${DEFAULT_BROWSER}
${HEADLESS} Get variable value ${HEADLESS} ${False}
&{options} = create dictionary headless=${HEADLESS}
Open browser ${HOME_PAGE_URL} options=${options}
Open browser ${HOME_PAGE_URL} browser=${BROWSER} options=${options}
10 changes: 7 additions & 3 deletions Examples/form-handler/form-submit.robot
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@ Library PuppeteerLibrary
Test Teardown Close All Browser
Suite Teardown Close Puppeteer

*** Variables ***
${DEFAULT_BROWSER} chrome


*** Test Cases ***
Submit login form
Open browser to test page http://127.0.0.1:7272/login-form-example.html
Input Text id=exampleInputEmail1 demo@qahive.com
Input Text id=exampleInputPassword1 123456789
Input Text xpath=//*[@id='exampleInputPassword1'] 123456789
Click Element id=exampleCheck1
Run Async Keywords
... Wait For New Window Open AND
... Click Element css=button[type="submit"]
Switch Window NEW
Wait Until Page Contains Login succeeded
Wait Until Page Contains Login succeeded

Submit register form
Open browser to test page http://127.0.0.1:7272/register-form-example.html
Expand All @@ -29,6 +32,7 @@ Submit register form
*** Keywords ***
Open browser to test page
[Arguments] ${url}
${BROWSER} = Get variable value ${BROWSER} ${DEFAULT_BROWSER}
${HEADLESS} Get variable value ${HEADLESS} ${False}
&{options} = create dictionary headless=${HEADLESS}
Open browser ${url} options=${options}
Open browser ${url} browser=${BROWSER} options=${options}
11 changes: 9 additions & 2 deletions Examples/form-handler/iframe.robot
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,24 @@ Suite Teardown Close Puppeteer


*** Variables ***
${DEFAULT_BROWSER} chrome
${HOME_PAGE_URL} http://127.0.0.1:7272/basic-html-elements.html


*** Test Cases ***
Interact with iframe element
Wait Until Page Contains Element id=ifrm
Select Frame id=ifrm
Input Text id=exampleInputEmail1 demo@qahive.com
Input Text xpath=//*[@id='exampleInputPassword1'] 123456789
Click Element id=exampleCheck1
Click Element xpath=//*[@id='exampleCheck1']
Unselect Frame
Wait Until Page Contains Element id=ifrm

*** Keywords ***
Open browser to test page
${BROWSER} = Get variable value ${BROWSER} ${DEFAULT_BROWSER}
${HEADLESS} Get variable value ${HEADLESS} ${False}
&{options} = create dictionary headless=${HEADLESS}
Open browser ${HOME_PAGE_URL} options=${options}
&{options} = create dictionary headless=${HEADLESS}
Open browser ${HOME_PAGE_URL} browser=${BROWSER} options=${options}
7 changes: 5 additions & 2 deletions Examples/input/mouse.robot
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
Library PuppeteerLibrary
Test Setup Open browser to test page
Test Teardown Close All Browser
Suite Teardown Close Puppeteer

*** Variables ***
${DEFAULT_BROWSER} chrome
# ${DEFAULT_BROWSER} webkit
${HOME_PAGE_URL} http://127.0.0.1:7272/basic-html-elements.html


Expand All @@ -22,7 +25,7 @@ Mouse drag

*** Keywords ***
Open browser to test page
${BROWSER} = Get variable value ${BROWSER} ${DEFAULT_BROWSER}
${HEADLESS} Get variable value ${HEADLESS} ${False}
&{options} = create dictionary headless=${HEADLESS}
Open browser ${HOME_PAGE_URL} options=${options}

Open browser ${HOME_PAGE_URL} browser=${BROWSER} options=${options}
Loading