@@ -53,6 +53,8 @@ describe('Playwright', function () {
53
53
waitForAction : 500 ,
54
54
timeout : 2000 ,
55
55
restart : false , // Don't restart browser to avoid hanging
56
+ networkIdleTimeout : 5000 , // Timeout for network requests
57
+ manualStart : false ,
56
58
chrome : {
57
59
args : [ '--no-sandbox' , '--disable-setuid-sandbox' ] ,
58
60
} ,
@@ -871,25 +873,28 @@ describe('Playwright', function () {
871
873
} )
872
874
873
875
describe ( '#dragAndDrop' , ( ) => {
874
- it ( 'Drag item from source to target (no iframe) @dragNdrop - customized steps' , ( ) =>
875
- I . amOnPage ( 'https://jqueryui.com/resources/demos/droppable/default.html' )
876
- . then ( ( ) => I . seeElementInDOM ( '#draggable' ) )
877
- . then ( ( ) => I . dragAndDrop ( '#draggable' , '#droppable' ) )
878
- . then ( ( ) => I . see ( 'Dropped' ) ) )
879
-
880
- it ( 'Drag item from source to target (no iframe) @dragNdrop - using Playwright API' , ( ) =>
881
- I . amOnPage ( 'https://jqueryui.com/resources/demos/droppable/default.html' )
882
- . then ( ( ) => I . seeElementInDOM ( '#draggable' ) )
883
- . then ( ( ) => I . dragAndDrop ( '#draggable' , '#droppable' , { force : true } ) )
884
- . then ( ( ) => I . see ( 'Dropped' ) ) )
885
-
886
- xit ( 'Drag and drop from within an iframe' , ( ) =>
887
- I . amOnPage ( 'https://jqueryui.com/droppable' )
888
- . then ( ( ) => I . resizeWindow ( 700 , 700 ) )
889
- . then ( ( ) => I . switchTo ( '//iframe[@class="demo-frame"]' ) )
890
- . then ( ( ) => I . seeElementInDOM ( '#draggable' ) )
891
- . then ( ( ) => I . dragAndDrop ( '#draggable' , '#droppable' ) )
892
- . then ( ( ) => I . see ( 'Dropped' ) ) )
876
+ it ( 'Drag item from source to target (no iframe) @dragNdrop - customized steps' , async function ( ) {
877
+ await I . amOnPage ( '/drag_drop.html' )
878
+ await I . seeElementInDOM ( '#draggable' )
879
+ await I . dragAndDrop ( '#draggable' , '#droppable' )
880
+ await I . see ( 'Dropped!' )
881
+ } )
882
+
883
+ it ( 'Drag item from source to target (no iframe) @dragNdrop - using Playwright API' , async function ( ) {
884
+ await I . amOnPage ( '/drag_drop.html' )
885
+ await I . seeElementInDOM ( '#draggable' )
886
+ await I . dragAndDrop ( '#draggable' , '#droppable' , { force : true } )
887
+ await I . see ( 'Dropped!' )
888
+ } )
889
+
890
+ it ( 'Drag and drop from within an iframe' , async function ( ) {
891
+ await I . amOnPage ( '/drag_drop.html' )
892
+ await I . resizeWindow ( 700 , 700 )
893
+ await I . switchTo ( '#test-iframe' )
894
+ await I . seeElementInDOM ( '#iframe-draggable' )
895
+ await I . dragAndDrop ( '#iframe-draggable' , '#iframe-droppable' )
896
+ await I . see ( 'Drop here' )
897
+ } )
893
898
} )
894
899
895
900
describe ( '#switchTo frame' , ( ) => {
@@ -1442,7 +1447,7 @@ describe('Playwright - Performance Metrics', () => {
1442
1447
} )
1443
1448
1444
1449
it ( 'grabs performance metrics' , async function ( ) {
1445
- this . timeout ( 10000 ) // Increase timeout for this test
1450
+ this . timeout ( 30000 ) // Increase timeout for external URL test
1446
1451
await I . amOnPage ( 'https://codecept.io' )
1447
1452
const metrics = await I . grabMetrics ( )
1448
1453
expect ( metrics . length ) . to . greaterThan ( 0 )
@@ -1551,17 +1556,17 @@ describe('Playwright - HAR', () => {
1551
1556
it ( 'replay from HAR - non existing file' , async ( ) => {
1552
1557
try {
1553
1558
await I . replayFromHar ( './non-existing-file.har' )
1554
- await I . amOnPage ( 'https://demo.playwright.dev/api-mocking ' )
1559
+ await I . amOnPage ( '/ ' )
1555
1560
} catch ( e ) {
1556
1561
expect ( e . message ) . to . include ( 'cannot be found on local system' )
1557
1562
}
1558
1563
} )
1559
1564
1560
- it ( 'replay from HAR' , async ( ) => {
1565
+ it ( 'replay from HAR' , async function ( ) {
1561
1566
const harFile = './test/data/sandbox/testHar.har'
1562
1567
await I . replayFromHar ( harFile )
1563
- await I . amOnPage ( 'https://demo.playwright.dev/api-mocking ' )
1564
- await I . see ( 'CodeceptJS ' )
1568
+ await I . amOnPage ( '/ ' )
1569
+ await I . see ( 'Welcome to test app ' )
1565
1570
} )
1566
1571
1567
1572
describe ( '#grabWebElements, #grabWebElement' , ( ) => {
@@ -1626,6 +1631,12 @@ describe('using data-testid attribute', () => {
1626
1631
} )
1627
1632
} )
1628
1633
1634
+ // Handle unhandled promise rejections
1635
+ process . on ( 'unhandledRejection' , ( reason , promise ) => {
1636
+ console . error ( 'Unhandled Rejection at:' , promise , 'reason:' , reason )
1637
+ // Don't exit the process, just log the error
1638
+ } )
1639
+
1629
1640
// Global after hook to ensure all browser instances are closed
1630
1641
after ( async function ( ) {
1631
1642
this . timeout ( 10000 ) // 10 second timeout for cleanup
0 commit comments