|
24 | 24 | from selenium.common.exceptions import NoSuchElementException |
25 | 25 | from selenium.common.exceptions import NoAlertPresentException |
26 | 26 | import unittest, time, re |
27 | | -from base import CppTestCase |
| 27 | +from base import * |
28 | 28 |
|
29 | 29 | class HidesDclItemsInDclRev(CppTestCase): |
30 | 30 | def test_hides_dcl_items_in_dcl_rev(self): |
31 | | - driver = self.driver |
32 | | - driver.get(self.base_url + "/w/test-gadget-stdrev/hides-dcl-items-in-dcl-rev") |
33 | | - self.assertRegexpMatches(driver.find_element_by_xpath("//body").text, r"^[\s\S]*void always_visible[\s\S]*$") |
34 | | - self.assertRegexpMatches(driver.find_element_by_xpath("//body").text, r"^[\s\S]*void not_visible_in_cxx98[\s\S]*$") |
35 | | - self.assertRegexpMatches(driver.find_element_by_xpath("//body").text, r"^[\s\S]*void not_visible_in_cxx11[\s\S]*$") |
36 | | - |
37 | | - Select(driver.find_element_by_css_selector("select")).select_by_visible_text("C++98/03") |
38 | | - self.assertRegexpMatches(driver.find_element_by_xpath("//body").text, r"^[\s\S]*void always_visible[\s\S]*$") |
39 | | - self.assertNotRegexpMatches(driver.find_element_by_xpath("//body").text, r"^[\s\S]*void not_visible_in_cxx98[\s\S]*$") |
40 | | - self.assertRegexpMatches(driver.find_element_by_xpath("//body").text, r"^[\s\S]*void not_visible_in_cxx11[\s\S]*$") |
41 | | - |
42 | | - Select(driver.find_element_by_css_selector("select")).select_by_visible_text("C++11") |
43 | | - self.assertRegexpMatches(driver.find_element_by_xpath("//body").text, r"^[\s\S]*void always_visible[\s\S]*$") |
44 | | - self.assertRegexpMatches(driver.find_element_by_xpath("//body").text, r"^[\s\S]*void not_visible_in_cxx98[\s\S]*$") |
45 | | - self.assertNotRegexpMatches(driver.find_element_by_xpath("//body").text, r"^[\s\S]*void not_visible_in_cxx11[\s\S]*$") |
| 31 | + self.get_page("test-gadget-stdrev/hides-dcl-items-in-dcl-rev") |
| 32 | + self.assert_text_in_body("void always_visible") |
| 33 | + self.assert_text_in_body("void not_visible_in_cxx98") |
| 34 | + self.assert_text_in_body("void not_visible_in_cxx11") |
| 35 | + |
| 36 | + self.select_cxx98() |
| 37 | + self.assert_text_in_body("void always_visible") |
| 38 | + self.assert_text_not_in_body("void not_visible_in_cxx98") |
| 39 | + self.assert_text_in_body("void not_visible_in_cxx11") |
| 40 | + |
| 41 | + self.select_cxx11() |
| 42 | + self.assert_text_in_body("void always_visible") |
| 43 | + self.assert_text_in_body("void not_visible_in_cxx98") |
| 44 | + self.assert_text_not_in_body("void not_visible_in_cxx11") |
0 commit comments