|
3 | 3 | import os.path |
4 | 4 |
|
5 | 5 | from base.base import BasePage |
| 6 | + |
6 | 7 | from config.constants import URL |
7 | 8 |
|
8 | 9 | from playwright.sync_api import expect |
@@ -51,7 +52,6 @@ class HomePage(BasePage): |
51 | 52 | ERROR_MSG_UNABLE_TO_PROCESS = "//span[normalize-space()='Unable to process the file']" |
52 | 53 | HARMFUL_FILE_2 = "//span[.='harmful_content_2 2.sql']" |
53 | 54 |
|
54 | | - |
55 | 55 | def __init__(self, page): |
56 | 56 | self.page = page |
57 | 57 |
|
@@ -92,7 +92,7 @@ def upload_all_files(self): |
92 | 92 | file_chooser = fc_info.value |
93 | 93 | current_working_dir = os.getcwd() |
94 | 94 | testdata_dir = os.path.join(current_working_dir, "testdata/valid_files") |
95 | | - |
| 95 | + |
96 | 96 | # Get all files from testdata/valid_files folder |
97 | 97 | all_files = [] |
98 | 98 | if os.path.exists(testdata_dir) and os.path.isdir(testdata_dir): |
@@ -138,7 +138,7 @@ def remove_first_three_files_and_validate_count(self): |
138 | 138 | remove_buttons = self.page.locator(self.REMOVE_FILE_BTN) |
139 | 139 |
|
140 | 140 | # Remove first three files |
141 | | - for i in range(3): |
| 141 | + for _i in range(3): |
142 | 142 | remove_buttons.first.click() |
143 | 143 | self.page.wait_for_timeout(2000) |
144 | 144 |
|
@@ -264,12 +264,12 @@ def upload_harmful_file_and_validate(self): |
264 | 264 | self.page.wait_for_timeout(10000) |
265 | 265 | self.page.wait_for_load_state("networkidle") |
266 | 266 | logger.info("Translation process started") |
267 | | - |
| 267 | + |
268 | 268 | # Click on harmful_content_2 2.sql file |
269 | 269 | self.page.locator(self.HARMFUL_FILE_2).click() |
270 | 270 | self.page.wait_for_timeout(2000) |
271 | 271 | logger.info("Clicked on harmful_content_2 2.sql file") |
272 | | - |
| 272 | + |
273 | 273 | # Validate error message is visible |
274 | 274 | try: |
275 | 275 | expect(self.page.locator(self.ERROR_MSG_UNABLE_TO_PROCESS)).to_be_visible(timeout=200000) |
|
0 commit comments