Skip to content

Commit

Permalink
Maintain test failure [deploy]
Browse files Browse the repository at this point in the history
Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
  • Loading branch information
VietND96 committed Dec 6, 2023
1 parent c4e7e10 commit 67c8a7b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/SeleniumTests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import unittest
import concurrent.futures
import os
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
Expand Down Expand Up @@ -66,16 +67,17 @@ def test_play_video(self):

def test_download_file(self):
driver = self.driver
driver.get('https://the-internet.herokuapp.com/download')
file_name = 'some-file.txt'
driver.get('https://demoqa.com/upload-download')
file_name = 'sampleFile.jpeg'
wait = WebDriverWait(driver, 30)
file_link = wait.until(
EC.element_to_be_clickable((By.LINK_TEXT, file_name))
EC.element_to_be_clickable((By.XPATH, f'//*[@download="{file_name}"]'))
)
file_link.click()
wait.until(
lambda d: str(d.get_downloadable_files()[0]).endswith(file_name)
)
time.sleep(5)
self.assertTrue(str(driver.get_downloadable_files()[0]).endswith(file_name))

def tearDown(self):
Expand Down

0 comments on commit 67c8a7b

Please sign in to comment.