@@ -53,6 +53,8 @@ describe('Playwright', function () {
5353 waitForAction : 500 ,
5454 timeout : 2000 ,
5555 restart : false , // Don't restart browser to avoid hanging
56+ networkIdleTimeout : 5000 , // Timeout for network requests
57+ manualStart : false ,
5658 chrome : {
5759 args : [ '--no-sandbox' , '--disable-setuid-sandbox' ] ,
5860 } ,
@@ -871,25 +873,28 @@ describe('Playwright', function () {
871873 } )
872874
873875 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+ } )
893898 } )
894899
895900 describe ( '#switchTo frame' , ( ) => {
@@ -1442,7 +1447,7 @@ describe('Playwright - Performance Metrics', () => {
14421447 } )
14431448
14441449 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
14461451 await I . amOnPage ( 'https://codecept.io' )
14471452 const metrics = await I . grabMetrics ( )
14481453 expect ( metrics . length ) . to . greaterThan ( 0 )
@@ -1551,17 +1556,17 @@ describe('Playwright - HAR', () => {
15511556 it ( 'replay from HAR - non existing file' , async ( ) => {
15521557 try {
15531558 await I . replayFromHar ( './non-existing-file.har' )
1554- await I . amOnPage ( 'https://demo.playwright.dev/api-mocking ' )
1559+ await I . amOnPage ( '/ ' )
15551560 } catch ( e ) {
15561561 expect ( e . message ) . to . include ( 'cannot be found on local system' )
15571562 }
15581563 } )
15591564
1560- it ( 'replay from HAR' , async ( ) => {
1565+ it ( 'replay from HAR' , async function ( ) {
15611566 const harFile = './test/data/sandbox/testHar.har'
15621567 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 ' )
15651570 } )
15661571
15671572 describe ( '#grabWebElements, #grabWebElement' , ( ) => {
@@ -1626,6 +1631,12 @@ describe('using data-testid attribute', () => {
16261631 } )
16271632} )
16281633
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+
16291640// Global after hook to ensure all browser instances are closed
16301641after ( async function ( ) {
16311642 this . timeout ( 10000 ) // 10 second timeout for cleanup
0 commit comments