Skip to content

Commit

Permalink
structure is improved
Browse files Browse the repository at this point in the history
  • Loading branch information
MarinaProsche committed Mar 11, 2024
1 parent 0d681ed commit d462a12
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 87 deletions.
10 changes: 2 additions & 8 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,6 @@ class StatisticTestSelenium(BasicSeleniumTest) with 1 test
Test check: if page "/check_list" opens


### Test for loading presentation:

class PresLoadTestSelenium(BasicSeleniumTest) with 1 test
Test check: if the presentation loads correctly
use path to "example_of_pres.pptx" from "/tests" (default) or your own example

### Test for open single check card:

class SingleCheckTestSelenium(BasicSeleniumTest) with 1 test
Expand All @@ -70,9 +64,9 @@ Test check: if page with random single check opens (from "/check_list")
class VersionTestSelenium(BasicSeleniumTest) with 1 test
Test check: if page "/version" opens and contains info from "VERSION.json"

### Test for loading report:
### Test for loading report and pres:

class ReportLoadTestSelenium(BasicSeleniumTest) with 2 tests
class FileLoadTestSelenium(BasicSeleniumTest) with 3 tests
Test check: if reports wit different extensions loads correctly
use default documents from "/tests" or your own example

Expand Down
3 changes: 3 additions & 0 deletions tests/basic_selenium_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

class BasicSeleniumTest(unittest.TestCase):

Expand Down Expand Up @@ -36,6 +38,7 @@ def authorization(self):
password.send_keys(password_param)
login_button = self.getDriver().find_element(By.ID, "login_button")
login_button.click()
WebDriverWait(self.driver, 10).until(EC.presence_of_element_located((By.ID, "upload_upload_button")))


def __init__(self, methodName='runTest', param=None):
Expand Down
5 changes: 2 additions & 3 deletions tests/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from test_pres_load import PresLoadTestSelenium
from test_single_card_check import SingleCheckTestSelenium
from test_version import VersionTestSelenium
from test_report_load import ReportLoadTestSelenium
from tests.test_file_load import FileLoadTestSelenium

def parse_arguments():
parser = argparse.ArgumentParser(description='Run Selenium tests with specified data')
Expand All @@ -29,8 +29,7 @@ def main():
suite = unittest.TestSuite()
suite.addTest(BasicSeleniumTest.parametrize(AuthTestSelenium, param=(args.host, args.login, args.password)))
suite.addTest(BasicSeleniumTest.parametrize(StatisticTestSelenium, param=(args.host, args.login, args.password)))
suite.addTest(BasicSeleniumTest.parametrize(ReportLoadTestSelenium, param=(args.host, args.login, args.password, args.report, args.report_doc)))
suite.addTest(BasicSeleniumTest.parametrize(PresLoadTestSelenium, param=(args.host, args.login, args.password, args.pres)))
suite.addTest(BasicSeleniumTest.parametrize(FileLoadTestSelenium, param=(args.host, args.login, args.password, args.report, args.report_doc, args.pres)))
suite.addTest(BasicSeleniumTest.parametrize(SingleCheckTestSelenium, param=(args.host, args.login, args.password)))
suite.addTest(BasicSeleniumTest.parametrize(VersionTestSelenium, param=(args.host, args.login, args.password)))

Expand Down
31 changes: 0 additions & 31 deletions tests/test_pres_load.py

This file was deleted.

41 changes: 0 additions & 41 deletions tests/test_report_load.py

This file was deleted.

1 change: 0 additions & 1 deletion tests/test_single_card_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ class SingleCheckTestSelenium(BasicSeleniumTest):

def test_open_check_card(self):
self.authorization()
time.sleep(10)
URL = self.getUrl('/check_list')
self.getDriver().get(URL)
self.getDriver().implicitly_wait(240)
Expand Down
1 change: 0 additions & 1 deletion tests/test_statistic.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ class StatisticTestSelenium(BasicSeleniumTest):

def test_open_statistic(self):
self.authorization()
time.sleep(10)
URL = self.getUrl('/check_list')
self.getDriver().get(URL)
self.getDriver().implicitly_wait(30)
Expand Down
5 changes: 3 additions & 2 deletions tests/test_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
import time
from basic_selenium_test import BasicSeleniumTest
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

class VersionTestSelenium(BasicSeleniumTest):

def test_version(self):
self.authorization()
time.sleep(10)
self.authorization()
URL = self.getUrl('/version')
self.getDriver().get(URL)
self.getDriver().implicitly_wait(30)
Expand Down

0 comments on commit d462a12

Please sign in to comment.