Skip to content

Commit 9d80090

Browse files
committed
Merge remote-tracking branch 'origin/master' into bugfix/failing_page_should_contain_element_with_list
# Conflicts: # atest/acceptance/locators/locator_parsing.robot
2 parents 684db2d + 62fe312 commit 9d80090

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+7073
-273
lines changed

.github/workflows/CI.yml

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ jobs:
1010
strategy:
1111
matrix:
1212
python-version: [3.8, 3.11] # 3.12, pypy-3.9
13-
rf-version: [4.1.3, 5.0.1, 6.0.1]
13+
rf-version: [5.0.1, 6.1.1, 7.0]
14+
selenium-version: [4.14.0, 4.15.2, 4.16.0, 4.17.2, 4.18.1, 4.19.0]
15+
browser: [firefox, chrome, headlesschrome] #edge
1416

1517
steps:
16-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
1719
- name: Set up Python ${{ matrix.python-version }} with Robot Framework ${{ matrix.rf-version }}
18-
uses: actions/setup-python@v4
20+
uses: actions/setup-python@v5
1921
with:
2022
python-version: ${{ matrix.python-version }}
2123
- name: Setup Chrome
@@ -26,6 +28,14 @@ jobs:
2628
- run: |
2729
echo Installed chromium version: ${{ steps.setup-chrome.outputs.chrome-version }}
2830
${{ steps.setup-chrome.outputs.chrome-path }} --version
31+
- name: Setup firefox
32+
id: setup-firefox
33+
uses: browser-actions/setup-firefox@v1
34+
with:
35+
firefox-version: latest
36+
- run: |
37+
echo Installed firefox versions: ${{ steps.setup-firefox.outputs.firefox-version }}
38+
${{ steps.setup-firefox.outputs.firefox-path }} --version
2939
- name: Start xvfb
3040
run: |
3141
export DISPLAY=:99.0
@@ -42,6 +52,9 @@ jobs:
4252
pip install -r requirements.txt
4353
pip install robotstatuschecker>=1.4
4454
pip install requests robotframework-pabot
55+
- name: Install Seleninum v${{ matrix.selenium-version }}
56+
run: |
57+
pip install --upgrade selenium==${{ matrix.selenium-version }}
4558
- name: Install RF ${{ matrix.rf-version }}
4659
run: |
4760
pip install -U --pre robotframework==${{ matrix.rf-version }}
@@ -56,36 +69,26 @@ jobs:
5669
run: |
5770
invoke gen-stub
5871
72+
# Temporarily ignoring pypy execution
5973
- name: Run tests with headless Chrome and with PyPy
60-
if: matrix.python-version == 'pypy-3.9'
74+
if: startsWith( matrix.python-version, 'pypy') == true
6175
run: |
6276
xvfb-run --auto-servernum python atest/run.py --nounit --zip headlesschrome
6377
64-
- name: Run tests with normal Chrome if CPython
65-
if: matrix.python-version != 'pypy-3.9'
66-
run: |
67-
xvfb-run --auto-servernum python atest/run.py --zip chrome
68-
69-
# Recognize for the moment this will NOT run as we aren't using Python 3.9
70-
- name: Run tests with headless Firefox with Python 3.9 and RF 4.1.3
71-
if: matrix.python-version == '3.9' && matrix.rf-version == '4.1.3'
72-
run: |
73-
xvfb-run --auto-servernum python atest/run.py --zip headlessfirefox
74-
75-
- name: Run tests with normal Firefox with Python 3.9 and RF != 4.1.3
76-
if: matrix.python-version == '3.9' && matrix.rf-version != '4.1.3'
78+
- name: Run tests with ${{ matrix.browser }} if CPython
79+
if: startsWith( matrix.python-version, 'pypy') == false
7780
run: |
78-
xvfb-run --auto-servernum python atest/run.py --zip firefox
81+
xvfb-run --auto-servernum python atest/run.py --zip ${{ matrix.browser }}
7982
8083
# - name: Run tests with Selenium Grid
81-
# if: matrix.python-version == '3.11' && matrix.rf-version == '3.2.2' && matrix.python-version != 'pypy-3.7'
84+
# if: matrix.python-version == '3.11' && matrix.rf-version == '3.2.2' && matrix.python-version != 'pypy-3.9'
8285
# run: |
8386
# wget --no-verbose --output-document=./selenium-server-standalone.jar http://selenium-release.storage.googleapis.com/3.141/selenium-server-standalone-3.141.59.jar
8487
# sudo chmod u+x ./selenium-server-standalone.jar
8588
# xvfb-run --auto-servernum python atest/run.py --zip headlesschrome --grid True
8689

8790
- uses: actions/upload-artifact@v1
88-
if: success() || failure()
91+
if: failure()
8992
with:
90-
name: Failed Test results
93+
name: SeleniumLibrary Test results
9194
path: atest/zip_results

BUILD.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ Testing
6464
-------
6565

6666
Make sure that adequate tests are executed before releases are created.
67-
See `<test/README.rst>`_ for details.
67+
For more information about unit tests see `<utest/README.rst>`_ or for
68+
acceptance tests see `<atest/README.rst>`_.
6869

6970
Preparation
7071
-----------

CONTRIBUTING.rst

Lines changed: 48 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,22 @@ Contribution guidelines
33

44
These guidelines instruct how to submit issues and contribute code to
55
the `SeleniumLibrary project`_. Other great ways to contribute include
6-
answering questions and participating discussion on `robotframework-users`_
7-
mailing list and other forums as well as spreading the word about the
8-
framework one way or the other.
6+
answering questions and participating in discussions within the
7+
#seleniumlibrary channel on the community `Robot Framework Slack`_, the
8+
`Robot Framework Forum`_ and other channels as well as spreading the word
9+
about the framework one way or the other.
910

1011
Submitting issues
1112
=================
1213

1314
Bugs and enhancements are tracked in the `issue tracker`_.
1415
If you are unsure if something is a bug or is a feature worth
15-
implementing, you can first ask on `robotframework-users`_ list. This and
16+
implementing, you can first ask within the `Robot Framework Slack`_. This and
1617
other similar forums, not the issue tracker, are also places where to ask
1718
general questions.
1819

19-
Before submitting a new issue, it is always a good idea to check is the
20-
same bug or enhancement already reported. If it is, please add your
20+
Before submitting a new issue, it is always a good idea to check if the
21+
same bug or enhancement is already reported. If it is, please add your
2122
comments to the existing issue instead of creating a new one.
2223

2324
Reporting bugs
@@ -43,9 +44,11 @@ Enhancement requests
4344

4445
Describe the new feature and use cases for it in as much detail as
4546
possible in an issue. Especially with larger enhancements, be prepared to
46-
contribute the code in form of a pull request as explained below or to
47+
contribute the code in the form of a pull request as explained below or to
4748
pay someone for the work. Consider also would it be better to implement this
48-
functionality as a separate library outside the SeleniumLibrary.
49+
functionality as a separate library outside the SeleniumLibrary. One option
50+
here is to extend SeleniumLibrary using the public API or plug-in api. Please
51+
see `extending documentation`_ for more details.
4952

5053
Code contributions
5154
==================
@@ -88,17 +91,25 @@ We do, however, recommend to create dedicated branches for pull requests
8891
instead of creating them based on the master branch. This is especially
8992
important if you plan to work on multiple pull requests at the same time.
9093

91-
This project requires that pull request contains linear history of commits and
92-
we do not allow that pull request contains merge commits or other noise. This helps
93-
the review process and makes the maintenance easier for the project administrators.
94-
Generally it is recommended to do `git pull --rebase` instead of the `git pull --merge`
95-
when there is need pull changes from upstream.
94+
This project asks that prior to making an enhancement pull request that you
95+
discuss the enhancement with the team. We wish to avoid having you spend effort on an
96+
ehancement that won't match with the project. We require that a pull request contains
97+
linear history of commits and we do not allow that pull request contains merge commits
98+
or other noise. This helps the review process and makes the maintenance easier for the
99+
project administrators. Generally it is recommended to do `git pull --rebase` instead
100+
of the `git pull --merge` when there is need pull changes from upstream.
96101

97102
Coding conventions
98103
------------------
99104

105+
The SeleniumLibrary team is currently reviewing, revising, and updating
106+
the coding conventions during Q1 2024. Knowing these coding conventions
107+
are seen as a good practice, we are leaving these here as recommendations
108+
in the mean time but are not forcing this as a requirement for accepting
109+
pull requests.
110+
100111
SeleniumLibrary uses the general Python code conventions defined in
101-
`PEP-8`_. In addition to that, we try to write `idiomatic Python`_
112+
`PEP-8`_. In addition to that, we try to write `idiomatic Python`_ or `"Pythonic" code`_
102113
and follow the `SOLID principles`_. with all new code. An important guideline
103114
is that the code should be clear enough that comments are generally not needed.
104115

@@ -145,7 +156,7 @@ individual keywords.
145156

146157
- All new enhancements or changes should have a note telling when the
147158
change was introduced. Often adding something like
148-
``New in SeleniumLibray 1.8.`` is enough.
159+
``New in SeleniumLibrary 1.8.`` is enough.
149160

150161
Keyword documentation can be easily created using `invoke`_ task::
151162

@@ -159,34 +170,38 @@ Tests
159170
When submitting a pull request with a new feature or a fix, you should
160171
always include tests for your changes. These tests prove that your
161172
changes work, help prevent bugs in the future, and help document what
162-
your changes do. Depending an the change, you may need
163-
``acceptance tests``\ *, ``unit tests``* or both.
173+
your changes do. Depending an the change, you may need ``acceptance tests``,
174+
``unit tests`` or both.
164175

165176
Make sure to run all of the tests before submitting a pull request to be
166177
sure that your changes do not break anything. If you can, test in
167178
multiple browsers and versions (Firefox, Chrome, IE, Edge etc). Pull requests
168-
are also automatically tested on `Travis CI`_.
179+
are also automatically tested on `GitHub Actions`_.
169180

170181
Acceptance tests
171182
~~~~~~~~~~~~~~~~
172183

173184
Most of SeleniumLibrary's testing is done using acceptance tests that
174185
naturally use Robot Framework itself for testing. Every new
175186
functionality or fix should generally get one or more acceptance tests.
187+
For more details on acceptance tests and how to run the acceptance tests,
188+
see `atest/README.rst`_.
176189

177190
Unit tests
178191
~~~~~~~~~~
179192

180193
Unit tests are great for testing internal logic and should be added when
181-
appropriate. For more details see `Unit and acceptance
182-
tests <https://github.com/robotframework/SeleniumLibrary/blob/master/BUILD.rst#unit-and-acceptance-tests%3E>`__.
194+
appropriate. For more details on unit tests and running them, see
195+
`utest/README.rst`_.
183196

184197
Continuous integration
185198
----------------------
186199

187-
SeleniumLibrary's continuous integration (CI) servers are visible through
188-
`Travis CI`_. For more details about how to run test and how `Travis CI`_
189-
integration is implemented can be found from the `test/README.rst`_.
200+
SeleniumLibrary uses GitHub Actions as it's continuous integration (CI) server.
201+
202+
.. ToDo: re-add when explanation of GitHUb Actions is written
203+
More details about how `GitHub Actions`_ integration is implemented can be
204+
found within `<.github/CI/README.rst>.
190205
191206
Finalizing pull requests
192207
------------------------
@@ -198,7 +213,7 @@ Acknowledgments
198213
~~~~~~~~~~~~~~~
199214

200215
If you have done any non-trivial change and would like to be credited,
201-
remind us to add `acknowledge` tag to the issue. This way we will add
216+
remind us to add ``acknowledge`` tag to the issue. This way we will add
202217
your name to the release notes, when next release is made.
203218

204219
Resolving conflicts
@@ -209,22 +224,26 @@ the same code as your changes. In that case you should
209224
`sync your fork`_ and `resolve conflicts`_ to allow for an easy merge.
210225

211226
.. _SeleniumLibrary project: https://github.com/robotframework/SeleniumLibrary
212-
.. _robotframework-users: http://groups.google.com/group/robotframework-users
227+
.. _Robot Framework Slack: https://rf-invite.herokuapp.com/
228+
.. _Robot Framework Forum: https://forum.robotframework.org/c/libraries/lib-seleniumlibrary/11
213229
.. _issue tracker: https://github.com/robotframework/SeleniumLibrary/issues
214230
.. _(SSCCE): http://sscce.org
231+
.. _extending documentation: https://github.com/robotframework/SeleniumLibrary/blob/master/docs/extending/extending.rst
215232
.. _GitHub account: https://github.com/
216233
.. _Git: https://git-scm.com
217234
.. _set up Git: https://help.github.com/articles/set-up-git/
218235
.. _fork a repository: https://help.github.com/articles/fork-a-repo/
219236
.. _use pull requests: https://help.github.com/articles/using-pull-requests
220237
.. _PEP-8: https://www.python.org/dev/peps/pep-0008/
221-
.. _idiomatic Python: http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html
238+
.. _idiomatic Python: https://en.wikibooks.org/wiki/Python_Programming/Idioms
239+
.. _"Pythonic" code: https://docs.python-guide.org/writing/style/
222240
.. _SOLID principles: https://en.wikipedia.org/wiki/SOLID_(object-oriented_design)
223241
.. _PEP-257: https://www.python.org/dev/peps/pep-0257/
224242
.. _invoke: http://www.pyinvoke.org/
225-
.. _Travis CI: https://travis-ci.org/robotframework/SeleniumLibrary
226-
.. _test/README.rst`: https://github.com/robotframework/SeleniumLibrary/blob/master/test/README.rst
243+
.. _GitHub Actions: https://github.com/robotframework/SeleniumLibrary/actions
244+
.. _atest/README.rst: https://github.com/robotframework/SeleniumLibrary/tree/master/atest/README.rst
245+
.. _utest/README.rst: https://github.com/robotframework/SeleniumLibrary/blob/master/utest/README.rst
227246
.. _sync your fork: https://help.github.com/articles/syncing-a-fork/
228247
.. _resolve conflicts: https://help.github.com/articles/resolving-a-merge-conflict-from-the-command-line
229248
.. _Black: https://github.com/psf/black
230-
.. _flake8: https://gitlab.com/pycqa/flake8
249+
.. _flake8: https://github.com/PyCQA/flake8

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ different versions and the overall project history.
2828
.. image:: https://img.shields.io/pypi/l/robotframework-seleniumlibrary.svg
2929
:target: https://www.apache.org/licenses/LICENSE-2.0
3030

31-
.. image:: https://github.com/robotframework/SeleniumLibrary/workflows/SeleniumLibrary%20CI/badge.svg
32-
:target: https://github.com/robotframework/SeleniumLibrary/actions?query=workflow%3A%22SeleniumLibrary+CI%22
31+
.. image:: https://github.com/robotframework/SeleniumLibrary/actions/workflows/CI.yml/badge.svg?branch=master
32+
:target: https://github.com/robotframework/SeleniumLibrary/actions/workflows/CI.yml
3333

3434
Keyword Documentation
3535
---------------------

atest/acceptance/2-event_firing_webdriver/event_firing_webdriver.robot

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Library SeleniumLibrary event_firing_webdriver=${CURDIR}/../../resources/testlibs/MyListener.py
33
Resource resource_event_firing_webdriver.robot
44
Suite Setup Open Browser ${FRONT PAGE} ${BROWSER} alias=event_firing_webdriver
5-
... remote_url=${REMOTE_URL} executable_path=%{WEBDRIVERPATH}
5+
... remote_url=${REMOTE_URL}
66
Suite Teardown Close All Browsers
77

88
*** Variables ***
@@ -12,10 +12,9 @@ ${event_firing_or_none} ${NONE}
1212
Open Browser To Start Page
1313
[Tags] NoGrid
1414
[Documentation]
15-
... LOG 1:20 DEBUG Wrapping driver to event_firing_webdriver.
16-
... LOG 1:22 INFO Got driver also from SeleniumLibrary.
15+
... LOG 1:31 DEBUG Wrapping driver to event_firing_webdriver.
16+
... LOG 1:33 INFO Got driver also from SeleniumLibrary.
1717
Open Browser ${FRONT PAGE} ${BROWSER} remote_url=${REMOTE_URL}
18-
... executable_path=%{WEBDRIVERPATH}
1918

2019
Event Firing Webdriver Go To (WebDriver)
2120
[Tags] NoGrid

atest/acceptance/2-event_firing_webdriver/resource_event_firing_webdriver.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ${DESIRED_CAPABILITIES}= ${NONE}
66
${ROOT}= http://${SERVER}/html
77
${FRONT_PAGE}= ${ROOT}/
88

9-
*** Keyword ***
9+
*** Keywords ***
1010

1111
Go To Page "${relative url}"
1212
[Documentation] Goes to page

atest/acceptance/__init__.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*** Setting ***
1+
*** Settings ***
22
Resource resource.robot
33
Force Tags Regression
44

atest/acceptance/big_list_of_naught_strings.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*** Setting ***
1+
*** Settings ***
22
Resource resource.robot
33
Library BigListOfNaughtyStrings.BigListOfNaughtyStrings WITH NAME blns
44

atest/acceptance/create_webdriver.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*** Setting ***
1+
*** Settings ***
22
Documentation Tests Webdriver
33
Resource resource.robot
44
Library Collections
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
*** Test Cases ***
2+
# Wait Until Element State Is (Not)
3+
# Get Element State
4+
# Element States Should (Not) Be
5+
6+
Check waiting for condition that takes a element
7+
Fail
8+
9+
Check waiting for condition that takes a title
10+
Fail
11+
12+
Check waiting for condition that takes a url
13+
Fail
14+
Wait Until url contains google
15+
# verify took 2 seconds
16+
17+
Check waiting for condition that takes locator and string
18+
Wait Until Element State Is ${condition} ${locator} ${string}
19+
Wait Until Element State Is ${condition} ${element}
20+
Wait Until Condition Is ${condition} ${target}
21+
Wait Until Condition Is ${condition} ${whatelse you need for this condition}
22+
23+
24+
Wait Until State Is number_of_windows_to_be
25+
Wait Until Expected Condition Is number_of_windows_to_be
26+
Wait Until Condition Is number of windows to be 5
27+
Wait Until Condition Is text to be present in element attribute //some/xpath/to/an/element href http://hello
28+
29+
Wait Until Condition Is number of windows to be 5 text to be present in element attribute //some/xpath/to/an/element href http://hello
30+
31+
Wait Until number of windows to be 5
32+
Wait Until text to be present in element attribute //some/xpath/to/an/element href http://hello
33+
Get Condition
34+
Is number of windows to be 5

0 commit comments

Comments
 (0)