You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it('should throw error when calling grabWebSocketMessages before startRecordingWebSocketMessages',()=>{
1072
-
if(process.env.BROWSER==='firefox')this.skip();
1073
-
try{
1074
-
I.amOnPage('https://websocketstest.com/');
1075
-
I.waitForText('Work for You!');
1076
-
I.grabWebSocketMessages();
1077
-
}catch(e){
1078
-
expect(e.message).to.equal('Failure in test automation. You use "I.grabWebSocketMessages", but "I.startRecordingWebSocketMessages" was never called before.');
1079
-
}
1080
-
});
1081
-
1082
-
it('should flush the WS messages',async()=>{
1083
-
if(process.env.BROWSER==='firefox')this.skip();
1084
-
awaitI.startRecordingWebSocketMessages();
1085
-
I.amOnPage('https://websocketstest.com/');
1086
-
I.waitForText('Work for You!');
1087
-
I.flushNetworkTraffics();
1088
-
constwsMessages=I.grabWebSocketMessages();
1089
-
expect(wsMessages.length).to.equal(0);
1090
-
});
1091
-
1092
-
it('should see recording WS messages',async()=>{
1093
-
if(process.env.BROWSER==='firefox')this.skip();
1094
-
awaitI.startRecordingWebSocketMessages();
1095
-
awaitI.amOnPage('https://websocketstest.com/');
1096
-
I.waitForText('Work for You!');
1097
-
constwsMessages=I.grabWebSocketMessages();
1098
-
expect(wsMessages.length).to.greaterThan(0);
1099
-
});
1100
-
1101
-
it('should not see recording WS messages',async()=>{
it('should throw error when calling grabWebSocketMessages before startRecordingWebSocketMessages',()=>{
1621
+
try{
1622
+
I.amOnPage('https://websocketstest.com/');
1623
+
I.waitForText('Work for You!');
1624
+
I.grabWebSocketMessages();
1625
+
}catch(e){
1626
+
expect(e.message).to.equal('Failure in test automation. You use "I.grabWebSocketMessages", but "I.startRecordingWebSocketMessages" was never called before.');
1627
+
}
1628
+
});
1629
+
1630
+
it('should flush the WS messages',async()=>{
1631
+
awaitI.startRecordingWebSocketMessages();
1632
+
I.amOnPage('https://websocketstest.com/');
1633
+
I.waitForText('Work for You!');
1634
+
I.flushWebSocketMessages();
1635
+
constwsMessages=I.grabWebSocketMessages();
1636
+
expect(wsMessages.length).to.equal(0);
1637
+
});
1638
+
1639
+
it('should see recording WS messages',async()=>{
1640
+
awaitI.startRecordingWebSocketMessages();
1641
+
awaitI.amOnPage('https://websocketstest.com/');
1642
+
I.waitForText('Work for You!');
1643
+
constwsMessages=awaitI.grabWebSocketMessages();
1644
+
expect(wsMessages.length).to.greaterThan(0);
1645
+
});
1646
+
1647
+
it('should not see recording WS messages',async()=>{
0 commit comments