Skip to content

Commit

Permalink
Merge pull request #169 from jdi-testing/revert-168-1563-bug-system-d…
Browse files Browse the repository at this point in the history
…oesnt-recognize-that-the-element-is-invisible-2

Revert "1563 bug system doesnt recognize that the element is invisible 2"
  • Loading branch information
Ekaterina-Zykova authored Nov 21, 2023
2 parents 61d9670 + 9131a83 commit dc9923e
Show file tree
Hide file tree
Showing 9 changed files with 143 additions and 16 deletions.
13 changes: 0 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,6 @@ RUN apt-get update -y && \

RUN apt install -y curl wget mc gcc make

RUN apt-get update && \
apt-get install -y --no-install-recommends gnupg wget curl unzip && \
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list && \
apt-get update -y && \
apt-get install -y --no-install-recommends google-chrome-stable && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /var/cache/apt/* && \
CHROME_VERSION=$(google-chrome --product-version) && \
wget -q --continue -P /chromedriver "https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/$CHROME_VERSION/linux64/chromedriver-linux64.zip" && \
unzip /chromedriver/chromedriver* -d /usr/local/bin/ && \
rm -rf /chromedriver \

ENV APP_HOME=/jdi-qasp-ml
WORKDIR ${APP_HOME}

Expand Down
15 changes: 12 additions & 3 deletions app/selenium_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,18 @@ def get_element_id_to_is_displayed_mapping(page_content_str):
chrome_options = Options()
chrome_options.add_argument("--no-sandbox")
chrome_options.add_argument("--headless")
chrome_options.add_argument('--disable-dev-shm-usage')
driver = webdriver.Chrome(
executable_path="/usr/local/bin/chromedriver-linux64/chromedriver", options=chrome_options)

capabilities = {
"browserName": "chrome",
"browserVersion": "118.0",
"selenoid:options": {
"enableVideo": False
}
}

driver = webdriver.Remote(
command_executor="http://jdi-qasp-ml-selenoid:4444/wd/hub",
desired_capabilities=capabilities, options=chrome_options)

driver.execute_script("document.body.insertAdjacentHTML('beforeend', arguments[0]);", dom)
wait = WebDriverWait(driver, 10)
Expand Down
17 changes: 17 additions & 0 deletions browsers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"chrome": {
"default": "91.0",
"versions": {
"91.0": {
"image": "selenoid/vnc_chrome:91.0",
"port": "4444"
}, "114.0": {
"image": "selenoid/vnc_chrome:114.0",
"port": "4444"
}, "118.0": {
"image": "selenoid/vnc_chrome:118.0",
"port": "4444"
}
}
}
}
19 changes: 19 additions & 0 deletions docker-compose-rc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,25 @@ services:
environment:
ENV: LOCAL

chrome:
image: selenoid/vnc_chrome:118.0
logging:
driver: none

selenoid:
container_name: "jdi-qasp-ml-selenoid"
image: "aerokube/selenoid:latest"
ports:
- "4445:4444"
volumes:
- ".:/etc/selenoid"
- "./target:/output"
- "/var/run/docker.sock:/var/run/docker.sock"
- "./target:/opt/selenoid/video"
environment:
- "OVERRIDE_VIDEO_OUTPUT_DIR=$PWD/target"
command: [ "-conf", "/etc/selenoid/browsers.json", "-video-output-dir", "/opt/selenoid/video", "-container-network", "jdi-qasp-ml_default" ]

celery:
image: "ghcr.io/jdi-testing/jdi-qasp-ml:rc"
container_name: jdi-qasp-ml-celery
Expand Down
19 changes: 19 additions & 0 deletions docker-compose-stable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,25 @@ services:
options:
max-size: "256m"

chrome:
image: selenoid/vnc_chrome:118.0
logging:
driver: none

selenoid:
container_name: "jdi-qasp-ml-selenoid"
image: "aerokube/selenoid:latest"
ports:
- "4445:4444"
volumes:
- ".:/etc/selenoid"
- "./target:/output"
- "/var/run/docker.sock:/var/run/docker.sock"
- "./target:/opt/selenoid/video"
environment:
- "OVERRIDE_VIDEO_OUTPUT_DIR=$PWD/target"
command: [ "-conf", "/etc/selenoid/browsers.json", "-video-output-dir", "/opt/selenoid/video", "-container-network", "jdi-qasp-ml_default" ]

celery:
image: "ghcr.io/jdi-testing/jdi-qasp-ml:stable"
container_name: jdi-qasp-ml-celery
Expand Down
19 changes: 19 additions & 0 deletions docker-compose.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,25 @@ services:
options:
max-size: "256m"

chrome:
image: selenoid/vnc_chrome:118.0
logging:
driver: none

selenoid:
container_name: "jdi-qasp-ml-selenoid"
image: "aerokube/selenoid:latest"
ports:
- "4445:4444"
volumes:
- ".:/etc/selenoid"
- "./target:/output"
- "/var/run/docker.sock:/var/run/docker.sock"
- "./target:/opt/selenoid/video"
environment:
- "OVERRIDE_VIDEO_OUTPUT_DIR=$PWD/target"
command: [ "-conf", "/etc/selenoid/browsers.json", "-video-output-dir", "/opt/selenoid/video", "-container-network", "jdi-qasp-ml_default"]

celery:
container_name: jdi-qasp-ml-celery
command: celery -A app.celery_app:celery_app worker -l info
Expand Down
19 changes: 19 additions & 0 deletions docker-compose.remote_server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,25 @@ services:
options:
max-size: "256m"

chrome:
image: selenoid/vnc_chrome:118.0
logging:
driver: none

selenoid:
container_name: "jdi-qasp-ml-selenoid"
image: "aerokube/selenoid:latest"
ports:
- "4445:4444"
volumes:
- ".:/etc/selenoid"
- "./target:/output"
- "/var/run/docker.sock:/var/run/docker.sock"
- "./target:/opt/selenoid/video"
environment:
- "OVERRIDE_VIDEO_OUTPUT_DIR=$PWD/target"
command: [ "-conf", "/etc/selenoid/browsers.json", "-video-output-dir", "/opt/selenoid/video", "-container-network", "jdi-qasp-ml_default" ]

celery:
container_name: jdi-qasp-ml-celery
command: celery -A app.celery_app:celery_app worker -l info
Expand Down
19 changes: 19 additions & 0 deletions docker-compose.remote_server_dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,25 @@ services:
options:
max-size: "256m"

chrome:
image: selenoid/vnc_chrome:118.0
logging:
driver: none

selenoid:
container_name: "jdi-qasp-ml-selenoid"
image: "aerokube/selenoid:latest"
ports:
- "4445:4444"
volumes:
- ".:/etc/selenoid"
- "./target:/output"
- "/var/run/docker.sock:/var/run/docker.sock"
- "./target:/opt/selenoid/video"
environment:
- "OVERRIDE_VIDEO_OUTPUT_DIR=$PWD/target"
command: [ "-conf", "/etc/selenoid/browsers.json", "-video-output-dir", "/opt/selenoid/video", "-container-network", "jdi-qasp-ml_default" ]

celery-dev:
container_name: jdi-qasp-ml-celery-dev
command: celery -A app.celery_app:celery_app worker -l info
Expand Down
19 changes: 19 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,25 @@ services:
environment:
ENV: LOCAL

chrome:
image: selenoid/vnc_chrome:118.0
logging:
driver: none

selenoid:
container_name: "jdi-qasp-ml-selenoid"
image: "aerokube/selenoid:latest"
ports:
- "4445:4444"
volumes:
- ".:/etc/selenoid"
- "./target:/output"
- "/var/run/docker.sock:/var/run/docker.sock"
- "./target:/opt/selenoid/video"
environment:
- "OVERRIDE_VIDEO_OUTPUT_DIR=$PWD/target"
command: [ "-conf", "/etc/selenoid/browsers.json", "-video-output-dir", "/opt/selenoid/video", "-container-network", "jdi-qasp-ml_default" ]

celery:
image: "ghcr.io/jdi-testing/jdi-qasp-ml:latest"
container_name: jdi-qasp-ml-celery
Expand Down

0 comments on commit dc9923e

Please sign in to comment.