Skip to content
Snippets Groups Projects
Commit e6fdf0a5 authored by Jakob Dieterle's avatar Jakob Dieterle
Browse files

Fixing tests after update to yarn

parent 90f6361a
Branches
Tags
1 merge request!285Resolve "Create new yarn lockfile"
Pipeline #253174 failed
......@@ -3,6 +3,7 @@ import logging
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as ec
from selenium.webdriver.common.action_chains import ActionChains
from core.models import UserAccount
from functional_tests.util import (GradyTestCase, login, reset_browser_after_test)
......@@ -50,7 +51,11 @@ class TestAutoLogout(GradyTestCase):
logout_dialog = self.browser.find_element_by_id('logout-dialog')
WebDriverWait(self.browser, 15, 0.2).until(
ec.visibility_of_element_located((By.ID, 'logout-dialog')))
logout_dialog.find_element_by_id('continue-btn').click()
# the below line should work for clicking the button, but something
# obscures it, thus the workaround below the comment
# logout_dialog.find_element_by_id('continue-btn').click()
continue_btn = logout_dialog.find_element_by_id('continue-btn')
ActionChains(self.browser).move_to_element(continue_btn).click().perform()
WebDriverWait(self.browser, 15, 0.2).until(
ec.invisibility_of_element_located((By.ID, 'logout-dialog')))
self.assertNotIn('login', self.browser.current_url)
......
......@@ -44,7 +44,8 @@ class FeedbackLabelSystemTest(GradyTestCase):
self.browser.find_elements_by_class_name('v-color-picker__color')[colour_num].click()
self.browser.find_element_by_id('create-label-btn').click()
WebDriverWait(self.browser, 10).until(query_returns_object(FeedbackLabel, name=name))
self.browser.find_element_by_class_name('notification').click()
#WebDriverWait(self.browser, 10).until(self.browser.find_element_by_class_name('notification'))
self.browser.find_element_by_class_name('notification-title').click()
# updates an already existing label with the given arguments
def update_label(self, old_name, new_name, description, colour_num):
......@@ -72,7 +73,7 @@ class FeedbackLabelSystemTest(GradyTestCase):
WebDriverWait(self.browser, 10).until(
query_returns_object(FeedbackLabel, name=old_name + new_name)
)
self.browser.find_element_by_class_name('notification').click()
self.browser.find_element_by_class_name('notification-title').click()
def assign_label_to_feedback(self, name):
label_input = self.browser.find_element_by_xpath(
......
from selenium.webdriver import ActionChains
from selenium.webdriver.support import expected_conditions as ec
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from core.models import UserAccount
......@@ -62,8 +64,11 @@ class TestFeedbackUpdate(GradyTestCase):
# Go to first tab and update the submission as the first tutor via the Feedback History page
self.browser.switch_to.window(first_tab)
self.browser.find_element_by_partial_link_text('Feedback History').click()
WebDriverWait(self.browser, 15, 0.2).until(
ec.visibility_of_element_located((By.CLASS_NAME, 'feedback-row')))
feedback_entry = self.browser.find_element_by_class_name('feedback-row')
ActionChains(self.browser).move_to_element(feedback_entry).click().perform()
self.browser.find_element_by_id('submit-feedback').click()
# as the second tutor, submit the validated feedback
......
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support import expected_conditions as ec
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.action_chains import ActionChains
from constance.test import override_config
from core.models import UserAccount
......@@ -129,7 +130,9 @@ class LoginPageTest(GradyTestCase):
self.browser.get(self.live_server_url)
self.browser.find_element_by_id('register').click()
self.browser.find_element_by_id('gdpr-notice')
self.browser.find_element_by_id('accept-gdpr-notice').click()
#self.browser.find_element_by_id('accept-gdpr-notice').click()
accept_btn = self.browser.find_element_by_id('accept-gdpr-notice')
ActionChains(self.browser).move_to_element(accept_btn).click().perform()
username_input = self.browser.find_element_by_id('input-register-username')
username_input.send_keys(username)
instance_password_input = self.browser.find_element_by_id(
......
......@@ -2,6 +2,8 @@ from selenium.webdriver.common.by import By
from selenium.webdriver.remote.webelement import WebElement
from selenium.webdriver.support import expected_conditions as ec
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.action_chains import ActionChains
from core import models
from functional_tests.util import (GradyTestCase, login, query_returns_object,
......@@ -68,7 +70,9 @@ class TestSolutionComments(GradyTestCase):
self._write_comment()
solution_table = self.browser.find_element_by_class_name('solution-table')
solution_table.find_element_by_class_name('delete-button').click()
self.browser.find_element_by_id('confirm-delete-comment').click()
#self.browser.find_element_by_id('confirm-delete-comment').click()
delete_btn = self.browser.find_element_by_id('confirm-delete-comment')
ActionChains(self.browser).move_to_element(delete_btn).click().perform()
WebDriverWait(self.browser, 10).until_not(
query_returns_object(models.SolutionComment),
"Solution comment not deleted."
......@@ -125,7 +129,9 @@ class TestSolutionComments(GradyTestCase):
sub_types.find_element_by_tag_name('div').click()
solution_table = self.browser.find_element_by_class_name('solution-table')
solution_table.find_element_by_class_name('delete-button').click()
self.browser.find_element_by_id('confirm-delete-comment').click()
#self.browser.find_element_by_id('confirm-delete-comment').click()
delete_btn = self.browser.find_element_by_id('confirm-delete-comment')
ActionChains(self.browser).move_to_element(delete_btn).click().perform()
WebDriverWait(self.browser, 10).until_not(
ec.presence_of_element_located((By.CLASS_NAME, 'dialog-box'))
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment