@@ -75,6 +75,45 @@ export function tests() {
7575 const url = await I . grabCurrentUrl ( )
7676 assert . equal ( url , `${ siteUrl } /info` )
7777 } )
78+
79+ it ( 'should check for equality with query strings' , async ( ) => {
80+ await I . amOnPage ( '/info?user=test' )
81+ // Query strings matter for exact equality
82+ await I . seeCurrentUrlEquals ( '/info?user=test' )
83+ await I . dontSeeCurrentUrlEquals ( '/info' )
84+ // But substring check works
85+ await I . seeInCurrentUrl ( '/info' )
86+ await I . seeInCurrentUrl ( 'user=test' )
87+ } )
88+
89+ it ( 'should handle root path with query strings' , async ( ) => {
90+ await I . amOnPage ( '/?user=ok' )
91+ // Query strings matter - exact equality requires query string
92+ await I . seeCurrentUrlEquals ( '/?user=ok' )
93+ await I . dontSeeCurrentUrlEquals ( '/' )
94+ // But substring check works for path fragment
95+ await I . seeInCurrentUrl ( '/' )
96+ } )
97+
98+ it ( 'should check path equality ignoring query strings' , async ( ) => {
99+ await I . amOnPage ( '/info?user=test' )
100+ // Path equality ignores query strings
101+ await I . seeCurrentPathEquals ( '/info' )
102+ await I . dontSeeCurrentPathEquals ( '/form' )
103+ await I . dontSeeCurrentPathEquals ( '/info?user=test' )
104+ } )
105+
106+ it ( 'should check root path equality ignoring query strings' , async ( ) => {
107+ await I . amOnPage ( '/?user=ok' )
108+ await I . seeCurrentPathEquals ( '/' )
109+ await I . dontSeeCurrentPathEquals ( '/info' )
110+ } )
111+
112+ it ( 'should check path equality ignoring hash fragments' , async ( ) => {
113+ await I . amOnPage ( '/info#section' )
114+ await I . seeCurrentPathEquals ( '/info' )
115+ await I . dontSeeCurrentPathEquals ( '/info#section' )
116+ } )
78117 } )
79118
80119 describe ( '#waitInUrl, #waitUrlEquals' , ( ) => {
0 commit comments