-
Notifications
You must be signed in to change notification settings - Fork 80
[WIP] Ptitloup/add selenium test #955
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
base: develop
Are you sure you want to change the base?
Changes from 34 commits
b7f0719
3ecb4e1
7083b9e
676f2cf
3631e52
05ef9e2
192fd56
ac6877a
f08759c
cdd5afe
d9d9407
635cf3b
1872b38
4ad22b3
6a3c128
b8a6506
1f89280
822516e
101f4de
2576eb5
b794c66
13edd02
32d88c2
4655644
780a19a
bcbd751
4c07fd6
36f00d7
ee39dd3
7feb000
1750786
ed79b40
5e47555
f86d25c
826f14b
aadaca6
5eb3861
0dc7a7c
d110424
23389a5
81a134e
5aff4ed
db414c3
fc58774
87aadde
65487d5
ff0a6a3
441e9b3
209520e
c9d1f05
7d889d9
d4b1311
13e83ea
8cdddd5
f8c8bb5
a8c4494
3f57994
8a14fef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,6 +25,17 @@ RUN apt-get clean && apt-get update \ | |
| ffmpegthumbnailer \ | ||
| imagemagick | ||
|
|
||
| RUN apt-get install -y firefox-esr xvfb | ||
|
|
||
| # Download, unzip, and install geckodriver | ||
| RUN wget https://github.com/mozilla/geckodriver/releases/download/v0.33.0/geckodriver-v0.33.0-linux64.tar.gz | ||
| RUN tar -zxf geckodriver-v0.33.0-linux64.tar.gz -C /usr/local/bin | ||
| RUN chmod +x /usr/local/bin/geckodriver | ||
|
|
||
| # Set display port and dbus env to avoid hanging | ||
| ENV DISPLAY=:99 | ||
| ENV DBUS_SESSION_BUS_ADDRESS=/dev/null | ||
|
|
||
|
Comment on lines
+29
to
+39
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Je suggère cette approche pour gérer Selenium avec une image docker. # https://github.com/SeleniumHQ/docker-selenium/blob/trunk/docker-compose-v3.yml
selenium-chrome:
image: selenium/standalone-chrome:116.0-chromedriver-116.0
container_name: selenium-chrome
volumes:
- /dev/shm:/dev/shm
network_mode: hostQuelques avantages (permet de):
Désavantage:
Issue: docker/roadmap#238 Il y a, cependant, des solutions de contournement, que je n'ai pas explorées, exemple pour Mac: https://github.com/chipmk/docker-mac-net-connect |
||
| WORKDIR /usr/src/app | ||
|
|
||
| COPY ./requirements.txt . | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| { | ||
| "id": "f060a750-1757-4b5d-8ed0-ce6b1c49b62b", | ||
| "version": "2.0", | ||
| "name": "pod-front", | ||
| "url": "http://localhost:9090/", | ||
| "tests": [{ | ||
| "id": "pod-accept-cookies", | ||
| "name": "cookies", | ||
| "commands": [{ | ||
| "id": "pod-open-home", | ||
| "comment": "Ouvre la page d'accueil", | ||
| "command": "open", | ||
| "target": "/", | ||
| "targets": [], | ||
| "value": "" | ||
| }, { | ||
| "id": "pod-accept-cookies", | ||
| "comment": "Valide les cookies du navigateur", | ||
| "command": "click", | ||
| "target": "id=okcookie", | ||
| "targets": [], | ||
| "value": "" | ||
| }] | ||
| }], | ||
| "suites": [{ | ||
| "id": "pod-front", | ||
| "name": "Esup Pod test selenium", | ||
| "persistSession": false, | ||
| "parallel": false, | ||
| "timeout": 300, | ||
| "tests": ["pod-accept-cookies"] | ||
| }], | ||
| "urls": ["http://localhost:9090/"], | ||
| "plugins": [] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| { | ||
| "id": "f060a750-1757-4b5d-8ed0-ce6b1c49b62b", | ||
| "version": "2.0", | ||
| "name": "pod-front", | ||
| "url": "http://localhost:9090/", | ||
| "tests": [{ | ||
| "id": "pod-change-lang", | ||
| "name": "lang", | ||
| "commands": [{ | ||
| "id": "pod-open-home", | ||
| "comment": "Ouvre la page d'accueil", | ||
| "command": "open", | ||
| "target": "/", | ||
| "targets": [], | ||
| "value": "" | ||
| },{ | ||
| "id": "pod-open-configuration", | ||
| "comment": "Ouvre la page de configuration", | ||
| "command": "click", | ||
| "target": "id=pod-param-buttons__button", | ||
| "targets": [ | ||
| ["id=pod-param-buttons__button", "id"], | ||
| ["css=#pod-param-buttons__button", "css:finder"], | ||
| ["xpath=//button[@id='pod-param-buttons__button']", "xpath:attributes"], | ||
| ["xpath=//li[@id='pod-param-buttons']/button", "xpath:idRelative"], | ||
| ["xpath=//nav/div/ul/li/button", "xpath:position"] | ||
| ], | ||
| "value": "" | ||
| }, { | ||
| "id": "pod-toggle-langue-menu", | ||
| "comment": "Sélectionne menu choix langue", | ||
| "command": "mouseOver", | ||
| "target": "id=pod-lang-select", | ||
| "targets": [ | ||
| ["id=pod-lang-select", "id"], | ||
| ["css=#pod-lang-select", "css:finder"], | ||
| ["xpath=//button[@id='pod-lang-select']", "xpath:attributes"], | ||
| ["xpath=//div[@id='pod-navbar__menusettings']/div[2]/ul/li/div/div/button", "xpath:idRelative"], | ||
| ["xpath=//div[2]/ul/li/div/div/button", "xpath:position"] | ||
| ], | ||
| "value": "" | ||
| }, { | ||
| "id": "pod-toggle-lang-select", | ||
| "comment": "Sélectionne la langue", | ||
| "command": "click", | ||
| "target": "id=pod-lang-select", | ||
| "targets": [ | ||
| ["id=pod-lang-select", "id"], | ||
| ["css=#pod-lang-select", "css:finder"], | ||
| ["xpath=//button[@id='pod-lang-select']", "xpath:attributes"], | ||
| ["xpath=//div[@id='pod-navbar__menusettings']/div[2]/ul/li/div/div/button", "xpath:idRelative"], | ||
| ["xpath=//div[2]/ul/li/div/div/button", "xpath:position"] | ||
| ], | ||
| "value": "" | ||
| }, { | ||
| "id": "pod-toggle-lang-deselect", | ||
| "comment": "Déselectionne langue actuelle", | ||
| "command": "mouseOut", | ||
| "target": "id=pod-lang-select", | ||
| "targets": [ | ||
| ["id=pod-lang-select", "id"], | ||
| ["css=#pod-lang-select", "css:finder"], | ||
| ["xpath=//button[@id='pod-lang-select']", "xpath:attributes"], | ||
| ["xpath=//div[@id='pod-navbar__menusettings']/div[2]/ul/li/div/div/button", "xpath:idRelative"], | ||
| ["xpath=//div[2]/ul/li/div/div/button", "xpath:position"] | ||
| ], | ||
| "value": "" | ||
| }, { | ||
| "id": "pod-toggle-lang-confirmation", | ||
| "comment": "Sélectionne langue ciblée", | ||
| "command": "click", | ||
| "target": "css=.dropdown-item", | ||
| "targets": [ | ||
| ["css=.dropdown-item", "css:finder"], | ||
| ["xpath=//input[@value='English (en)']", "xpath:attributes"], | ||
| ["xpath=//div[@id='pod-navbar__menusettings']/div[2]/ul/li/div/div/div/form/input[3]", "xpath:idRelative"], | ||
| ["xpath=//input[3]", "xpath:position"] | ||
| ], | ||
| "value": "" | ||
| }] | ||
| }], | ||
| "suites": [{ | ||
| "id": "pod-front", | ||
| "name": "Esup Pod test selenium", | ||
| "persistSession": false, | ||
| "parallel": false, | ||
| "timeout": 300, | ||
| "tests": ["pod-change-lang"] | ||
| }], | ||
| "urls": ["http://localhost:9090/"], | ||
| "plugins": [] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| { | ||
| "id": "f060a750-1757-4b5d-8ed0-ce6b1c49b62b", | ||
| "version": "2.0", | ||
| "name": "pod-front", | ||
| "url": "http://localhost:9090/", | ||
| "tests": [{ | ||
| "id": "pod-searchbar", | ||
| "name": "search", | ||
| "commands": [{ | ||
| "id": "pod-open-home", | ||
| "comment": "Ouvre la page d'accueil", | ||
| "command": "open", | ||
| "target": "/", | ||
| "targets": [], | ||
| "value": "" | ||
| }, { | ||
| "id": "pod-search", | ||
| "comment": "Sélectionne barre recherche", | ||
| "command": "click", | ||
| "target": "id=s", | ||
| "targets": [ | ||
| ["id=s", "id"], | ||
| ["name=q", "name"], | ||
| ["css=#s", "css:finder"], | ||
| ["xpath=//input[@id='s']", "xpath:attributes"], | ||
| ["xpath=//form[@id='nav-search']/input", "xpath:idRelative"], | ||
| ["xpath=//input", "xpath:position"] | ||
| ], | ||
| "value": "" | ||
| }, { | ||
| "id": "pod-search-type", | ||
| "comment": "Tape mot clé", | ||
| "command": "type", | ||
| "target": "id=s", | ||
| "targets": [ | ||
| ["id=s", "id"], | ||
| ["name=q", "name"], | ||
| ["css=#s", "css:finder"], | ||
| ["xpath=//input[@id='s']", "xpath:attributes"], | ||
| ["xpath=//form[@id='nav-search']/input", "xpath:idRelative"], | ||
| ["xpath=//input", "xpath:position"] | ||
| ], | ||
| "value": "pas de résultat attendu" | ||
| }, { | ||
| "id": "pod-search-enter", | ||
| "comment": "Appuie touche entrée", | ||
| "command": "sendKeys", | ||
| "target": "id=s", | ||
| "targets": [ | ||
| ["id=s", "id"], | ||
| ["name=q", "name"], | ||
| ["css=#s", "css:finder"], | ||
| ["xpath=//input[@id='s']", "xpath:attributes"], | ||
| ["xpath=//form[@id='nav-search']/input", "xpath:idRelative"], | ||
| ["xpath=//input", "xpath:position"] | ||
| ], | ||
| "value": "${KEY_ENTER}" | ||
| }, { | ||
| "id": "pod-accueil-ariane", | ||
| "comment": "Retour à la page d'accueil via logo pod", | ||
| "command": "click", | ||
| "target": "xpath=//div[@id='nav-mainbar']/a/strong", | ||
| "targets": [ | ||
| ["css=strong", "css:finder"], | ||
| ["xpath=//div[@id='nav-mainbar']/a/strong", "xpath:idRelative"], | ||
| ["xpath=//strong", "xpath:position"], | ||
| ["xpath=//strong[contains(.,'Lille.Pod')]", "xpath:innerText"] | ||
| ], | ||
| "value": "" | ||
| }] | ||
| }], | ||
| "suites": [{ | ||
| "id": "pod-front", | ||
| "name": "Esup Pod test selenium", | ||
| "persistSession": false, | ||
| "parallel": false, | ||
| "timeout": 300, | ||
| "tests": ["pod-searchbar"] | ||
| }], | ||
| "urls": ["http://localhost:9090/"], | ||
| "plugins": [] | ||
| } |

Uh oh!
There was an error while loading. Please reload this page.