Skip to content

Commit

Permalink
test: Remove ScheduleEditTests.testUnschedule (#5607)
Browse files Browse the repository at this point in the history
* test: Remove ScheduleEditTests.testUnschedule

Has been disabled under Django 2. Simple refactoring does not make it
functional under Django 3. Probably because we know that Selenium does
not handle HTML5 drag-and-drop well. Discarding until we move to a
better JS testing framework.

* test: Remove unused imports
  • Loading branch information
jennifer-richards authored May 12, 2023
1 parent 96396b8 commit 1419a0e
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions ietf/meeting/tests_js.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
import shutil
import os
import re
from unittest import skipIf

import django
from django.utils import timezone
from django.utils.text import slugify
from django.db.models import F
Expand Down Expand Up @@ -880,42 +878,6 @@ def test_session_constraint_hints(self):
self.assertNotIn('would-violate-hint', session_elements[4].get_attribute('class'),
'Constraint violation should not be indicated on non-conflicting session')

@ifSeleniumEnabled
@skipIf(django.VERSION[0]==2, "Skipping test with race conditions under Django 2")
class ScheduleEditTests(IetfSeleniumTestCase):
def testUnschedule(self):

meeting = make_meeting_test_data()

self.assertEqual(SchedTimeSessAssignment.objects.filter(session__meeting=meeting, session__group__acronym='mars', schedule__name='test-schedule').count(),1)


ss = list(SchedTimeSessAssignment.objects.filter(session__meeting__number=72,session__group__acronym='mars',schedule__name='test-schedule')) # pyflakes:ignore

self.login()
url = self.absreverse('ietf.meeting.views.edit_meeting_schedule',kwargs=dict(num='72',name='test-schedule',owner='[email protected]'))
self.driver.get(url)

# driver.get() will wait for scripts to finish, but not ajax
# requests. Wait for completion of the permissions check:
read_only_note = self.driver.find_element(By.ID, 'read_only')
WebDriverWait(self.driver, 10).until(expected_conditions.invisibility_of_element(read_only_note), "Read-only schedule")

s1 = Session.objects.filter(group__acronym='mars', meeting=meeting).first()
selector = "#session_{}".format(s1.pk)
WebDriverWait(self.driver, 30).until(expected_conditions.presence_of_element_located((By.CSS_SELECTOR, selector)), "Did not find %s"%selector)

self.assertEqual(self.driver.find_elements(By.CSS_SELECTOR, "#sortable-list #session_{}".format(s1.pk)), [])

element = self.driver.find_element(By.ID, 'session_{}'.format(s1.pk))
target = self.driver.find_element(By.ID, 'sortable-list')
ActionChains(self.driver).drag_and_drop(element,target).perform()

self.assertTrue(self.driver.find_elements(By.CSS_SELECTOR, "#sortable-list #session_{}".format(s1.pk)))

time.sleep(0.1) # The API that modifies the database runs async

self.assertEqual(SchedTimeSessAssignment.objects.filter(session__meeting__number=72,session__group__acronym='mars',schedule__name='test-schedule').count(),0)

@ifSeleniumEnabled
class SlideReorderTests(IetfSeleniumTestCase):
Expand Down

0 comments on commit 1419a0e

Please sign in to comment.