File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
examples/javascript/test/interactions Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -85,4 +85,34 @@ describe('Interactions - Windows', function () {
85
85
const windowsAfterClose = await driver . getAllWindowHandles ( ) ;
86
86
assert . strictEqual ( windowsAfterClose . length , 2 ) ;
87
87
} ) ;
88
+
89
+ it ( 'Should be able to getWindow Size' , async function ( ) {
90
+ await driver . get ( 'https://www.selenium.dev/selenium/web/' ) ;
91
+
92
+ // Access each dimension individually
93
+ const { width, height } = await driver . manage ( ) . window ( ) . getRect ( ) ;
94
+
95
+ // Or store the dimensions and query them later
96
+ const rect = await driver . manage ( ) . window ( ) . getRect ( ) ;
97
+ const windowWidth = rect . width ;
98
+ const windowHeight = rect . height ;
99
+
100
+ assert . ok ( windowWidth > 0 ) ;
101
+ assert . ok ( windowHeight > 0 ) ;
102
+ } ) ;
103
+
104
+ it ( 'Should be able to getWindow position' , async function ( ) {
105
+ await driver . get ( 'https://www.selenium.dev/selenium/web/' ) ;
106
+
107
+ // Access each dimension individually
108
+ const { x, y } = await driver . manage ( ) . window ( ) . getRect ( ) ;
109
+
110
+ // Or store the dimensions and query them later
111
+ const rect = await driver . manage ( ) . window ( ) . getRect ( ) ;
112
+ const x1 = rect . x ;
113
+ const y1 = rect . y ;
114
+
115
+ assert . ok ( x1 >= 0 ) ;
116
+ assert . ok ( y1 >= 0 ) ;
117
+ } ) ;
88
118
} ) ;
You can’t perform that action at this time.
0 commit comments