Skip to content
Snippets Groups Projects
Commit 343d8165 authored by Thilo Wischmeyer's avatar Thilo Wischmeyer Committed by Dominik Seeger
Browse files

Hide errors when all submissions are corrected

parent 81bc97b7
Branches
Tags
1 merge request!251Hide errors when all submissions are corrected
Pipeline #162108 canceled
......@@ -44,6 +44,9 @@ export default class SubscriptionForList extends Vue {
}
get correctionRoute() {
if (!this.active)
return undefined
const group = Assignments.state.assignmentCreation.group
const group_pk = group !== undefined ? group.pk : undefined
......
......@@ -6,6 +6,7 @@ const errorUrlBlacklist = [
'/api/get-token/',
'/api/.*/change_password/',
'/api/corrector/register/',
'/api/assignment/'
]
const blackListRegExp = new RegExp(parseBlacklist(errorUrlBlacklist), 'g')
......
......@@ -10,7 +10,7 @@ from selenium.webdriver.firefox.options import Options
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.common.exceptions import StaleElementReferenceException
from selenium.common.exceptions import StaleElementReferenceException, NoSuchElementException
from selenium.webdriver.common.by import By
from django.core.exceptions import ObjectDoesNotExist
from django.test import LiveServerTestCase
......@@ -100,10 +100,11 @@ def subscriptions_loaded_cond(browser):
for i in range(2):
try:
tasks_el = browser.find_element_by_name('subscription-list')
sub_links = tasks_el.find_elements_by_tag_name('a')
return any((link != '/home' for link in extract_hrefs_hashes(sub_links)))
tasks_el.find_element_by_class_name('v-progress-circular')
except StaleElementReferenceException:
pass
except NoSuchElementException:
return True
return False
return loaded
......@@ -123,7 +124,7 @@ def query_returns_object(model_class, **kwargs):
# stage can be 'initial', 'validate', or 'conflict'
def go_to_subscription(test_class_instance, stage='initial', sub_type=None):
WebDriverWait(test_class_instance.browser, 10).until(
subscriptions_loaded_cond(test_class_instance.browser)
subscriptions_loaded_cond(test_class_instance.browser),
)
tasks = test_class_instance.browser.find_element_by_name('subscription-list')
tab = tasks.find_element_by_xpath(f'//*[contains(text(), "{stage}")]')
......@@ -138,7 +139,7 @@ def go_to_subscription(test_class_instance, stage='initial', sub_type=None):
f'and not(contains(@class, "inactive-subscription")) ' \
f'and contains(@class, "subscription") ' \
f'and not(ancestor::div[contains(@style,"display: none;")])]'
print(tasks.find_elements_by_xpath(sub_type_xpath))
WebDriverWait(test_class_instance.browser, 10).until(
ec.element_to_be_clickable((By.XPATH, sub_type_xpath)),
message="SubmissionType not clickable"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment