1
+ """ Visual Layout Testing with different Syntax Formats """
2
+
1
3
from seleniumbase import BaseCase
2
4
3
5
6
+ class VisualLayout_FixtureTests ():
7
+ def test_python_home_change (sb ):
8
+ sb .open ("https://python.org/" )
9
+ print ('\n Creating baseline in "visual_baseline" folder.' )
10
+ sb .check_window (name = "python_home" , baseline = True )
11
+ # Remove the "Donate" button
12
+ sb .remove_element ("a.donate-button" )
13
+ print ("(This test should fail)" ) # due to missing button
14
+ sb .check_window (name = "python_home" , level = 3 )
15
+
16
+
4
17
class VisualLayoutFailureTests (BaseCase ):
5
18
def test_applitools_change (self ):
6
19
self .open ("https://applitools.com/helloworld?diff1" )
@@ -10,24 +23,15 @@ def test_applitools_change(self):
10
23
self .click ('a[href="?diff1"]' )
11
24
# Click a button that makes a hidden element visible
12
25
self .click ("button" )
13
- print ("(This test should fail)" )
26
+ print ("(This test should fail)" ) # due to image now seen
14
27
self .check_window (name = "helloworld" , level = 3 )
15
28
16
- def test_python_home_change (self ):
17
- self .open ("https://python.org/" )
18
- print ('\n Creating baseline in "visual_baseline" folder.' )
19
- self .check_window (name = "python_home" , baseline = True )
20
- # Remove the "Donate" button
21
- self .remove_element ("a.donate-button" )
22
- print ("(This test should fail)" )
23
- self .check_window (name = "python_home" , level = 3 )
24
-
25
29
def test_xkcd_logo_change (self ):
26
30
self .open ("https://xkcd.com/554/" )
27
31
print ('\n Creating baseline in "visual_baseline" folder.' )
28
32
self .check_window (name = "xkcd_554" , baseline = True )
29
33
# Change height: (83 -> 110) , Change width: (185 -> 120)
30
34
self .set_attribute ('[alt="xkcd.com logo"]' , "height" , "110" )
31
35
self .set_attribute ('[alt="xkcd.com logo"]' , "width" , "120" )
32
- print ("(This test should fail)" )
36
+ print ("(This test should fail)" ) # due to a resized logo
33
37
self .check_window (name = "xkcd_554" , level = 3 )
0 commit comments