That was even less clever of me

This commit is contained in:
2020-05-26 14:25:19 +01:00
parent 0bbc23853d
commit 3f78b9f05f
3 changed files with 4 additions and 1 deletions

View File

@@ -5,7 +5,7 @@ from selenium.webdriver.remote.webelement import WebElement
from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.select import Select from selenium.webdriver.support.select import Select
import datetime import datetime
from PyRIGS.tests.regions import Modal from PyRIGS.tests.regions import TextBox, Modal
class Header(Region): class Header(Region):

View File

@@ -127,6 +127,7 @@ class TestEventCreate(BaseRigboardTest):
# TODO Test validation with some wrong data # TODO Test validation with some wrong data
self.page.submit() self.page.submit()
self.driver.implicitly_wait(10)
self.assertTrue(self.page.success) self.assertTrue(self.page.success)
# TODO # TODO

View File

@@ -104,6 +104,7 @@ class TestAssetForm(AutoLoginTest):
self.parent = models.Asset.objects.create(asset_id="9000", description="Shelf", status=self.status, category=self.category, date_acquired=datetime.date(2000, 1, 1)) self.parent = models.Asset.objects.create(asset_id="9000", description="Shelf", status=self.status, category=self.category, date_acquired=datetime.date(2000, 1, 1))
self.connector = models.Connector.objects.create(description="IEC", current_rating=10, voltage_rating=240, num_pins=3) self.connector = models.Connector.objects.create(description="IEC", current_rating=10, voltage_rating=240, num_pins=3)
self.cable_type = models.CableType.objects.create(plug=self.connector, socket=self.connector, circuits=1, cores=3) self.cable_type = models.CableType.objects.create(plug=self.connector, socket=self.connector, circuits=1, cores=3)
self.wait = WebDriverWait(self.driver, 5)
self.page = pages.AssetCreate(self.driver, self.live_server_url).open() self.page = pages.AssetCreate(self.driver, self.live_server_url).open()
def test_asset_create(self): def test_asset_create(self):
@@ -145,6 +146,7 @@ class TestAssetForm(AutoLoginTest):
self.assertFalse(self.driver.find_element_by_id('cable-table').is_displayed()) self.assertFalse(self.driver.find_element_by_id('cable-table').is_displayed())
self.page.submit() self.page.submit()
self.wait.until(animation_is_finished())
self.assertTrue(self.page.success) self.assertTrue(self.page.success)
# Check that data is right # Check that data is right
asset = models.Asset.objects.get(asset_id="9001") asset = models.Asset.objects.get(asset_id="9001")