-
Notifications
You must be signed in to change notification settings - Fork 2
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
494 selenium+docker #503
Merged
Merged
494 selenium+docker #503
Changes from all commits
Commits
Show all changes
66 commits
Select commit
Hold shift + click to select a range
b8ee64e
add folder tests
MarinaProsche 2218ad6
add test folder and first test
MarinaProsche e095e91
first version of auyh tests
MarinaProsche 10950d7
added param in commandline and class
MarinaProsche 3dc0bb7
from basic test
MarinaProsche 05c504f
first version of test_statistic
MarinaProsche 76d7644
copied from 485
MarinaProsche 0c83e22
added test_debug.py
MarinaProsche 3333658
version_test done
MarinaProsche a45c1a1
tests/requirements.txt added
MarinaProsche c216d92
requrements.txt and def authorization() added
MarinaProsche 64af71e
base for new test
MarinaProsche 203f437
test is ready
MarinaProsche 2da1273
base for new selenium test
MarinaProsche 30ed760
change structure
MarinaProsche edd31ac
added pres example for testing
MarinaProsche 0a1847c
info in README.md
MarinaProsche 1d6d1e0
full test
MarinaProsche fbfd2bd
delete changes of restart.sh
MarinaProsche ed59b0f
Merge branch '481_first_selenium_test' into 485_selenium_test_statistic
MarinaProsche 0145493
test_statistic improved
MarinaProsche 83e8fa4
first try of Dockerfile_selenium
MarinaProsche 11febfa
Tests added in Docker (ready)
MarinaProsche b35315a
setting changed (Firefox to Chrome)
MarinaProsche b370b02
Merge branch '484_selenium_pres_load' into 494_selenium+docker
MarinaProsche 15712e0
default pres added
MarinaProsche be76b5e
486 merged
MarinaProsche 9f7f374
487 merged
MarinaProsche 81db6fa
load_report_test added
MarinaProsche a1b9f3c
full set of tests up to 28.02
MarinaProsche 139636e
added new docker-compose-tests
MarinaProsche 379ac42
docer-compose for tests ready
MarinaProsche 4714576
base of gh-actions for selenium
MarinaProsche 3ab790c
add check
MarinaProsche 2495daa
mistake fixed
MarinaProsche 0835838
set output
MarinaProsche 3d73311
loop added
MarinaProsche ed6b745
structure changed
MarinaProsche 8297fc7
try to fix test using time limit
MarinaProsche 2abbbc4
try another par
MarinaProsche 6631156
fixed condition
MarinaProsche 0d681ed
try to fix
MarinaProsche d462a12
structure is improved
MarinaProsche a53c77a
structure and test check changed
MarinaProsche 17ecf43
new folder
MarinaProsche 9320a19
fix mistake
MarinaProsche 86b2868
step results added
MarinaProsche 2730fe0
Some docker_check_tests.sh fixes for 494 (#508)
HadronCollider 3f40471
first part of improvment
MarinaProsche 9c4020f
2 part of improvement
MarinaProsche 271e198
version.json added
MarinaProsche f1ed726
added version.json
MarinaProsche e0a4378
remove VERSION.json
MarinaProsche bd918f9
merge master (fix requirements.txt conflict)
HadronCollider a438b33
change using crypto-js to md5 (for password hash)
HadronCollider 8f3cd06
update url to repo
HadronCollider d528cb3
download nltk and language_tool_python on worker ready
HadronCollider 977207e
Merge pull request #512 from moevm/project_updates
HadronCollider 7cf119f
Add CELERY_QUERIES to tests
HadronCollider 5523968
add default get_main_headers logic for base class
HadronCollider 37debe2
remove step 'Build system images (non-pulling)' for selenium workflow
HadronCollider 65376ab
fix mistake with main_header
MarinaProsche fb0b409
Merge branch '494_selenium+docker' into 466_fix_main_header_for_docx
HadronCollider 38b79c4
Merge pull request #514 from moevm/466_fix_main_header_for_docx
HadronCollider fcddd46
docker_check_tests.sh: logs are added, while-true is removed
MarinaProsche 92e8968
remove old docker-compose-tests, improved README, changed Dockerfile_…
MarinaProsche File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Selenium_tests | ||
|
||
on: [push] | ||
|
||
jobs: | ||
check_tests: | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Build docker-compose with docker-compose-selenium (tests) | ||
run: | | ||
cp .env_example .env | ||
cp app/VERSION_example.json app/VERSION.json | ||
docker-compose -f docker-compose.yml -f docker-compose-selenium.yml build | ||
|
||
- name: Run docker-compose with docker-compose-selenium (tests) | ||
run: | | ||
docker-compose -f docker-compose.yml -f docker-compose-selenium.yml up -d | ||
chmod +x tests/scripts/docker_check_tests.sh | ||
./tests/scripts/docker_check_tests.sh | ||
|
||
|
||
# jobs: | ||
# check_tests: | ||
# runs-on: ubuntu-20.04 | ||
|
||
# steps: | ||
# - uses: actions/checkout@v2 | ||
|
||
# - name: Simplify docker-compose file name | ||
# run: mv docker-compose-tests.yml docker-compose.yml | ||
|
||
# - name: Build system images (non-pulling) | ||
# run: | | ||
# # build base image | ||
# docker build -f Dockerfile_base -t osll/slides-base:20230202 . | ||
|
||
# - name: Run docker-compose tests | ||
# run: | | ||
# cp .env_example .env | ||
# docker-compose up -d | ||
# chmod +x tests/scripts/docker_check_tests.sh | ||
# ./tests/scripts/docker_check_tests.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM selenium/standalone-chrome:121.0-chromedriver-121.0-grid-4.18.0-20240220 | ||
|
||
ENV LOGIN="" | ||
ENV PASSWORD="" | ||
|
||
WORKDIR /usr/src/project | ||
|
||
USER root | ||
RUN apt-get update && \ | ||
apt-get install -y python3 python3-pip && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
COPY tests/requirements.txt tests/requirements.txt | ||
RUN pip install -r tests/requirements.txt | ||
COPY tests ./tests | ||
|
||
ENTRYPOINT python3 tests/main.py --login ${LOGIN} --password ${PASSWORD} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"commit": "", | ||
"message": "", | ||
"date": "", | ||
"version": "" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
version: '3.8' | ||
|
||
services: | ||
selenium-tests: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile_selenium | ||
environment: | ||
- LOGIN=${ADMIN_PASSWORD} | ||
- PASSWORD=${ADMIN_PASSWORD} | ||
depends_on: | ||
- web | ||
network_mode: service:web |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,4 @@ echo "{ | |
\"message\": \"$COMMIT_MSG\", | ||
\"date\": \"$DATE\", | ||
\"version\": \"$VERSION\" | ||
}" | ||
}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
|
||
## For local tests: | ||
|
||
```bash | ||
$ pip install -r tests/requirements.txt | ||
``` | ||
|
||
### Run tests: | ||
|
||
use login and password from .env | ||
You can run tests with your own data: | ||
|
||
```bash | ||
|
||
$ python3 tests/main.py --host host --login login --password password --pres your press --report your report --report_doc your report doc | ||
``` | ||
|
||
or use default setting: | ||
|
||
```bash | ||
$ python3 tests/main.py --login login --password password | ||
``` | ||
|
||
## Docker: | ||
|
||
### Dockerfile | ||
You can run tests with dockerfile_selenium independently, using special flag: | ||
|
||
```bash | ||
$ docker build -t your_image_name -f Dockerfile_selenium . | ||
$ docker run -e LOGIN=your_login -e PASSWORD=your password --network="host" your_image_name | ||
|
||
``` | ||
|
||
### Docker-compose | ||
You can run docker-compose-selenium with docker-compose: | ||
|
||
```bash | ||
$ docker-compose -f docker-compose.yml -f docker-compose-selenium.yml build | ||
$ docker-compose -f docker-compose.yml -f docker-compose-selenium.yml up | ||
|
||
``` | ||
|
||
## List of tests: | ||
|
||
### Test for autorization: | ||
|
||
class AuthTestSelenium(BasicSeleniumTest) with 3 tests | ||
Tests check: if page "/login" opens, if it doesn't take wrong login/password and takes correct. | ||
|
||
### Test for open page /check_list: | ||
|
||
class StatisticTestSelenium(BasicSeleniumTest) with 1 test | ||
Test check: if page "/check_list" opens | ||
|
||
|
||
### Test for open single check card: | ||
|
||
class SingleCheckTestSelenium(BasicSeleniumTest) with 1 test | ||
Test check: if page with random single check opens (from "/check_list") | ||
|
||
### Test for open page /version: | ||
|
||
class VersionTestSelenium(BasicSeleniumTest) with 1 test | ||
Test check: if page "/version" opens and contains info from "VERSION.json" | ||
|
||
### Test for loading report and pres: | ||
|
||
class FileLoadTestSelenium(BasicSeleniumTest) with 3 tests | ||
Test check: if reports wit different extensions loads correctly | ||
use default documents from "/tests" or your own example | ||
|
||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
По умолчанию всё запускается от root, поэтому, возможно, лишняя команда
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Комментарий ещё актуален
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Без команды возникает ошибка с правами.