From 4d70e49408df482bcf4df7b11347733b3468be53 Mon Sep 17 00:00:00 2001 From: Monal5031 Date: Tue, 15 May 2018 00:34:19 +0530 Subject: [PATCH] Create Base module for Tests Closes https://github.com/systers/vms/issues/674 --- Tests/__init__.py | 0 Tests/administrator/__init__.py | 0 Tests/administrator/test_working.py | 42 ++++++++++++++++++++++++++++ Tests/authentication/__init__.py | 0 Tests/authentication/test_working.py | 42 ++++++++++++++++++++++++++++ Tests/event/__init__.py | 0 Tests/event/test_working.py | 42 ++++++++++++++++++++++++++++ Tests/home/__init__.py | 0 Tests/home/test_working.py | 42 ++++++++++++++++++++++++++++ Tests/job/__init__.py | 0 Tests/job/test_working.py | 42 ++++++++++++++++++++++++++++ Tests/organization/__init__.py | 0 Tests/organization/test_working.py | 42 ++++++++++++++++++++++++++++ Tests/pom/__init__.py | 0 Tests/pom/test_working.py | 42 ++++++++++++++++++++++++++++ Tests/registration/__init__.py | 0 Tests/registration/test_working.py | 42 ++++++++++++++++++++++++++++ Tests/shift/__init__.py | 0 Tests/shift/test_working.py | 42 ++++++++++++++++++++++++++++ Tests/volunteer/__init__.py | 0 Tests/volunteer/test_working.py | 42 ++++++++++++++++++++++++++++ 21 files changed, 420 insertions(+) create mode 100644 Tests/__init__.py create mode 100644 Tests/administrator/__init__.py create mode 100644 Tests/administrator/test_working.py create mode 100644 Tests/authentication/__init__.py create mode 100644 Tests/authentication/test_working.py create mode 100644 Tests/event/__init__.py create mode 100644 Tests/event/test_working.py create mode 100644 Tests/home/__init__.py create mode 100644 Tests/home/test_working.py create mode 100644 Tests/job/__init__.py create mode 100644 Tests/job/test_working.py create mode 100644 Tests/organization/__init__.py create mode 100644 Tests/organization/test_working.py create mode 100644 Tests/pom/__init__.py create mode 100644 Tests/pom/test_working.py create mode 100644 Tests/registration/__init__.py create mode 100644 Tests/registration/test_working.py create mode 100644 Tests/shift/__init__.py create mode 100644 Tests/shift/test_working.py create mode 100644 Tests/volunteer/__init__.py create mode 100644 Tests/volunteer/test_working.py diff --git a/Tests/__init__.py b/Tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/Tests/administrator/__init__.py b/Tests/administrator/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/Tests/administrator/test_working.py b/Tests/administrator/test_working.py new file mode 100644 index 000000000..1474e41a6 --- /dev/null +++ b/Tests/administrator/test_working.py @@ -0,0 +1,42 @@ +# Third Party Imports +from selenium import webdriver + +# Django imports +from django.contrib.staticfiles.testing import LiveServerTestCase + + +# Local Project Imports +from selenium.webdriver.common.keys import Keys + + +class DummyTesting(LiveServerTestCase): + """ + Dummy Test Class to check the tests are working correctly. + """ + + @classmethod + def setUpClass(cls): + + cls.driver = webdriver.Firefox() + cls.driver.implicitly_wait(5) + cls.driver.maximize_window() + super(DummyTesting, cls).setUpClass() + + @classmethod + def tearDownClass(cls): + cls.driver.quit() + super(DummyTesting, cls).tearDownClass() + + def test_working(self): + """ + Dummy Test function to check working of selenium + Delete this function after the first test for this + Class is added. + """ + self.driver.get("http://www.python.org") + self.assertIn('Python', self.driver.title) + element = self.driver.find_element_by_name('q') + element.clear() + element.send_keys('pycon') + element.send_keys(Keys.RETURN) + self.assertNotIn('No results found.', self.driver.page_source) diff --git a/Tests/authentication/__init__.py b/Tests/authentication/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/Tests/authentication/test_working.py b/Tests/authentication/test_working.py new file mode 100644 index 000000000..1474e41a6 --- /dev/null +++ b/Tests/authentication/test_working.py @@ -0,0 +1,42 @@ +# Third Party Imports +from selenium import webdriver + +# Django imports +from django.contrib.staticfiles.testing import LiveServerTestCase + + +# Local Project Imports +from selenium.webdriver.common.keys import Keys + + +class DummyTesting(LiveServerTestCase): + """ + Dummy Test Class to check the tests are working correctly. + """ + + @classmethod + def setUpClass(cls): + + cls.driver = webdriver.Firefox() + cls.driver.implicitly_wait(5) + cls.driver.maximize_window() + super(DummyTesting, cls).setUpClass() + + @classmethod + def tearDownClass(cls): + cls.driver.quit() + super(DummyTesting, cls).tearDownClass() + + def test_working(self): + """ + Dummy Test function to check working of selenium + Delete this function after the first test for this + Class is added. + """ + self.driver.get("http://www.python.org") + self.assertIn('Python', self.driver.title) + element = self.driver.find_element_by_name('q') + element.clear() + element.send_keys('pycon') + element.send_keys(Keys.RETURN) + self.assertNotIn('No results found.', self.driver.page_source) diff --git a/Tests/event/__init__.py b/Tests/event/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/Tests/event/test_working.py b/Tests/event/test_working.py new file mode 100644 index 000000000..1474e41a6 --- /dev/null +++ b/Tests/event/test_working.py @@ -0,0 +1,42 @@ +# Third Party Imports +from selenium import webdriver + +# Django imports +from django.contrib.staticfiles.testing import LiveServerTestCase + + +# Local Project Imports +from selenium.webdriver.common.keys import Keys + + +class DummyTesting(LiveServerTestCase): + """ + Dummy Test Class to check the tests are working correctly. + """ + + @classmethod + def setUpClass(cls): + + cls.driver = webdriver.Firefox() + cls.driver.implicitly_wait(5) + cls.driver.maximize_window() + super(DummyTesting, cls).setUpClass() + + @classmethod + def tearDownClass(cls): + cls.driver.quit() + super(DummyTesting, cls).tearDownClass() + + def test_working(self): + """ + Dummy Test function to check working of selenium + Delete this function after the first test for this + Class is added. + """ + self.driver.get("http://www.python.org") + self.assertIn('Python', self.driver.title) + element = self.driver.find_element_by_name('q') + element.clear() + element.send_keys('pycon') + element.send_keys(Keys.RETURN) + self.assertNotIn('No results found.', self.driver.page_source) diff --git a/Tests/home/__init__.py b/Tests/home/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/Tests/home/test_working.py b/Tests/home/test_working.py new file mode 100644 index 000000000..1474e41a6 --- /dev/null +++ b/Tests/home/test_working.py @@ -0,0 +1,42 @@ +# Third Party Imports +from selenium import webdriver + +# Django imports +from django.contrib.staticfiles.testing import LiveServerTestCase + + +# Local Project Imports +from selenium.webdriver.common.keys import Keys + + +class DummyTesting(LiveServerTestCase): + """ + Dummy Test Class to check the tests are working correctly. + """ + + @classmethod + def setUpClass(cls): + + cls.driver = webdriver.Firefox() + cls.driver.implicitly_wait(5) + cls.driver.maximize_window() + super(DummyTesting, cls).setUpClass() + + @classmethod + def tearDownClass(cls): + cls.driver.quit() + super(DummyTesting, cls).tearDownClass() + + def test_working(self): + """ + Dummy Test function to check working of selenium + Delete this function after the first test for this + Class is added. + """ + self.driver.get("http://www.python.org") + self.assertIn('Python', self.driver.title) + element = self.driver.find_element_by_name('q') + element.clear() + element.send_keys('pycon') + element.send_keys(Keys.RETURN) + self.assertNotIn('No results found.', self.driver.page_source) diff --git a/Tests/job/__init__.py b/Tests/job/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/Tests/job/test_working.py b/Tests/job/test_working.py new file mode 100644 index 000000000..1474e41a6 --- /dev/null +++ b/Tests/job/test_working.py @@ -0,0 +1,42 @@ +# Third Party Imports +from selenium import webdriver + +# Django imports +from django.contrib.staticfiles.testing import LiveServerTestCase + + +# Local Project Imports +from selenium.webdriver.common.keys import Keys + + +class DummyTesting(LiveServerTestCase): + """ + Dummy Test Class to check the tests are working correctly. + """ + + @classmethod + def setUpClass(cls): + + cls.driver = webdriver.Firefox() + cls.driver.implicitly_wait(5) + cls.driver.maximize_window() + super(DummyTesting, cls).setUpClass() + + @classmethod + def tearDownClass(cls): + cls.driver.quit() + super(DummyTesting, cls).tearDownClass() + + def test_working(self): + """ + Dummy Test function to check working of selenium + Delete this function after the first test for this + Class is added. + """ + self.driver.get("http://www.python.org") + self.assertIn('Python', self.driver.title) + element = self.driver.find_element_by_name('q') + element.clear() + element.send_keys('pycon') + element.send_keys(Keys.RETURN) + self.assertNotIn('No results found.', self.driver.page_source) diff --git a/Tests/organization/__init__.py b/Tests/organization/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/Tests/organization/test_working.py b/Tests/organization/test_working.py new file mode 100644 index 000000000..1474e41a6 --- /dev/null +++ b/Tests/organization/test_working.py @@ -0,0 +1,42 @@ +# Third Party Imports +from selenium import webdriver + +# Django imports +from django.contrib.staticfiles.testing import LiveServerTestCase + + +# Local Project Imports +from selenium.webdriver.common.keys import Keys + + +class DummyTesting(LiveServerTestCase): + """ + Dummy Test Class to check the tests are working correctly. + """ + + @classmethod + def setUpClass(cls): + + cls.driver = webdriver.Firefox() + cls.driver.implicitly_wait(5) + cls.driver.maximize_window() + super(DummyTesting, cls).setUpClass() + + @classmethod + def tearDownClass(cls): + cls.driver.quit() + super(DummyTesting, cls).tearDownClass() + + def test_working(self): + """ + Dummy Test function to check working of selenium + Delete this function after the first test for this + Class is added. + """ + self.driver.get("http://www.python.org") + self.assertIn('Python', self.driver.title) + element = self.driver.find_element_by_name('q') + element.clear() + element.send_keys('pycon') + element.send_keys(Keys.RETURN) + self.assertNotIn('No results found.', self.driver.page_source) diff --git a/Tests/pom/__init__.py b/Tests/pom/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/Tests/pom/test_working.py b/Tests/pom/test_working.py new file mode 100644 index 000000000..1474e41a6 --- /dev/null +++ b/Tests/pom/test_working.py @@ -0,0 +1,42 @@ +# Third Party Imports +from selenium import webdriver + +# Django imports +from django.contrib.staticfiles.testing import LiveServerTestCase + + +# Local Project Imports +from selenium.webdriver.common.keys import Keys + + +class DummyTesting(LiveServerTestCase): + """ + Dummy Test Class to check the tests are working correctly. + """ + + @classmethod + def setUpClass(cls): + + cls.driver = webdriver.Firefox() + cls.driver.implicitly_wait(5) + cls.driver.maximize_window() + super(DummyTesting, cls).setUpClass() + + @classmethod + def tearDownClass(cls): + cls.driver.quit() + super(DummyTesting, cls).tearDownClass() + + def test_working(self): + """ + Dummy Test function to check working of selenium + Delete this function after the first test for this + Class is added. + """ + self.driver.get("http://www.python.org") + self.assertIn('Python', self.driver.title) + element = self.driver.find_element_by_name('q') + element.clear() + element.send_keys('pycon') + element.send_keys(Keys.RETURN) + self.assertNotIn('No results found.', self.driver.page_source) diff --git a/Tests/registration/__init__.py b/Tests/registration/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/Tests/registration/test_working.py b/Tests/registration/test_working.py new file mode 100644 index 000000000..1474e41a6 --- /dev/null +++ b/Tests/registration/test_working.py @@ -0,0 +1,42 @@ +# Third Party Imports +from selenium import webdriver + +# Django imports +from django.contrib.staticfiles.testing import LiveServerTestCase + + +# Local Project Imports +from selenium.webdriver.common.keys import Keys + + +class DummyTesting(LiveServerTestCase): + """ + Dummy Test Class to check the tests are working correctly. + """ + + @classmethod + def setUpClass(cls): + + cls.driver = webdriver.Firefox() + cls.driver.implicitly_wait(5) + cls.driver.maximize_window() + super(DummyTesting, cls).setUpClass() + + @classmethod + def tearDownClass(cls): + cls.driver.quit() + super(DummyTesting, cls).tearDownClass() + + def test_working(self): + """ + Dummy Test function to check working of selenium + Delete this function after the first test for this + Class is added. + """ + self.driver.get("http://www.python.org") + self.assertIn('Python', self.driver.title) + element = self.driver.find_element_by_name('q') + element.clear() + element.send_keys('pycon') + element.send_keys(Keys.RETURN) + self.assertNotIn('No results found.', self.driver.page_source) diff --git a/Tests/shift/__init__.py b/Tests/shift/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/Tests/shift/test_working.py b/Tests/shift/test_working.py new file mode 100644 index 000000000..1474e41a6 --- /dev/null +++ b/Tests/shift/test_working.py @@ -0,0 +1,42 @@ +# Third Party Imports +from selenium import webdriver + +# Django imports +from django.contrib.staticfiles.testing import LiveServerTestCase + + +# Local Project Imports +from selenium.webdriver.common.keys import Keys + + +class DummyTesting(LiveServerTestCase): + """ + Dummy Test Class to check the tests are working correctly. + """ + + @classmethod + def setUpClass(cls): + + cls.driver = webdriver.Firefox() + cls.driver.implicitly_wait(5) + cls.driver.maximize_window() + super(DummyTesting, cls).setUpClass() + + @classmethod + def tearDownClass(cls): + cls.driver.quit() + super(DummyTesting, cls).tearDownClass() + + def test_working(self): + """ + Dummy Test function to check working of selenium + Delete this function after the first test for this + Class is added. + """ + self.driver.get("http://www.python.org") + self.assertIn('Python', self.driver.title) + element = self.driver.find_element_by_name('q') + element.clear() + element.send_keys('pycon') + element.send_keys(Keys.RETURN) + self.assertNotIn('No results found.', self.driver.page_source) diff --git a/Tests/volunteer/__init__.py b/Tests/volunteer/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/Tests/volunteer/test_working.py b/Tests/volunteer/test_working.py new file mode 100644 index 000000000..1474e41a6 --- /dev/null +++ b/Tests/volunteer/test_working.py @@ -0,0 +1,42 @@ +# Third Party Imports +from selenium import webdriver + +# Django imports +from django.contrib.staticfiles.testing import LiveServerTestCase + + +# Local Project Imports +from selenium.webdriver.common.keys import Keys + + +class DummyTesting(LiveServerTestCase): + """ + Dummy Test Class to check the tests are working correctly. + """ + + @classmethod + def setUpClass(cls): + + cls.driver = webdriver.Firefox() + cls.driver.implicitly_wait(5) + cls.driver.maximize_window() + super(DummyTesting, cls).setUpClass() + + @classmethod + def tearDownClass(cls): + cls.driver.quit() + super(DummyTesting, cls).tearDownClass() + + def test_working(self): + """ + Dummy Test function to check working of selenium + Delete this function after the first test for this + Class is added. + """ + self.driver.get("http://www.python.org") + self.assertIn('Python', self.driver.title) + element = self.driver.find_element_by_name('q') + element.clear() + element.send_keys('pycon') + element.send_keys(Keys.RETURN) + self.assertNotIn('No results found.', self.driver.page_source)