Skip to content

Commit

Permalink
move goto_application_page to commons
Browse files Browse the repository at this point in the history
  • Loading branch information
amdomanska committed Apr 10, 2024
1 parent 5a2d7ed commit b6dd221
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException
from doajtest import selenium_helpers
from doajtest.selenium_helpers import SeleniumTestCase
from portality import models
from doajtest.fixtures.accounts import create_publisher_a
from doajtest.fixtures.url_path import URL_APPLY


class Interactions():
Expand All @@ -27,6 +31,13 @@ def clickNextButton(self):
self.clickButton(button_class_selector="nextBtn")


def goto_application_page(self, acc: models.Account = None):
publisher = acc or create_publisher_a()
selenium_helpers.login_by_acc(self.selenium, publisher)
selenium_helpers.goto(self.selenium, URL_APPLY)
return


SIMPLE_FIELDS_TYPES = ["text", "number", "url"]


Expand Down
11 changes: 1 addition & 10 deletions doajtest/seleniumtest/application_form/test_oa_compliance.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,11 @@
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import NoSuchElementException

from doajtest.fixtures.url_path import URL_APPLY
from doajtest.seleniumtest.application_form.test_application_form_commons import TestFieldsCommon
from doajtest.seleniumtest.application_form.test_application_form_commons import Interactions
from doajtest.fixtures.application_form_error_messages import FixtureMessages
from portality import models

from doajtest.fixtures.accounts import create_publisher_a


class ApplicationForm_OACompliance(SeleniumTestCase):

Expand All @@ -24,13 +21,7 @@ def setUp(self):
super().setUp()
self.common = TestFieldsCommon(self.selenium, self.js_click)
self.interact = Interactions(self.selenium, self.js_click)
self.goto_application_page()

def goto_application_page(self, acc: models.Account = None):
publisher = acc or create_publisher_a()
selenium_helpers.login_by_acc(self.selenium, publisher)
selenium_helpers.goto(self.selenium, URL_APPLY)
return
self.interact.goto_application_page()

def test_oa_statement(self):
field_name = "boai"
Expand Down

0 comments on commit b6dd221

Please sign in to comment.