File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,9 +8,12 @@ export const navigateToFolder = async ({
88 path : string
99} ) : Promise < void > => {
1010 const paths = path . split ( '/' )
11-
1211 for ( const name of paths ) {
13- await page . click ( `[data-test-resource-name="${ name } "]` )
12+ const resource = page . locator ( `[data-test-resource-name="${ name } "]` )
13+ await resource . click ( )
14+ await page . waitForResponse (
15+ ( resp ) => resp . url ( ) . includes ( encodeURIComponent ( name ) ) && resp . status ( ) === 200
16+ )
1417 }
1518}
1619
@@ -32,7 +35,6 @@ export const resourceExists = async ({
3235 timeout ?: number
3336} ) : Promise < boolean > => {
3437 let exist = true
35-
3638 await page . waitForSelector ( `[data-test-resource-name="${ name } "]` , { timeout } ) . catch ( ( e ) => {
3739 if ( ! ( e instanceof errors . TimeoutError ) ) {
3840 throw e
Original file line number Diff line number Diff line change @@ -271,6 +271,9 @@ export class AllFilesPage {
271271 }
272272 await page . click ( 'button.oc-files-actions-delete-trigger' )
273273 await page . click ( '.oc-modal-body-actions-confirm' )
274+ await page . waitForResponse (
275+ ( resp ) => resp . url ( ) . includes ( encodeURIComponent ( resouceName ) ) && resp . status ( ) === 204
276+ )
274277
275278 await page . goto ( startUrl )
276279 }
Original file line number Diff line number Diff line change @@ -14,21 +14,21 @@ export class SharedWithMePage {
1414
1515 async acceptShare ( { name } : { name : string } ) : Promise < void > {
1616 const { page } = this . actor
17+ const acceptShareButton = page . locator (
18+ `//*[@data-test-resource-name="${ name } "]/ancestor::tr//button[contains(@class, "file-row-share-status-accept")]`
19+ )
1720
18- await page
19- . locator (
20- `//*[@data-test-resource-name="${ name } "]/ancestor::tr//button[contains(@class, "file-row-share-status-accept")]`
21- )
22- . click ( )
21+ await acceptShareButton . click ( )
22+ await page . waitForResponse ( ( resp ) => resp . url ( ) . includes ( 'shares' ) && resp . status ( ) === 200 )
2323 }
2424
2525 async declineShare ( { name } : { name : string } ) : Promise < void > {
2626 const { page } = this . actor
27+ const declineShareButton = page . locator (
28+ `//*[@data-test-resource-name="${ name } "]/ancestor::tr//button[contains(@class, "file-row-share-decline")]`
29+ )
2730
28- await page
29- . locator (
30- `//*[@data-test-resource-name="${ name } "]/ancestor::tr//button[contains(@class, "file-row-share-decline")]`
31- )
32- . click ( )
31+ await declineShareButton . click ( )
32+ await page . waitForResponse ( ( resp ) => resp . url ( ) . includes ( 'shares' ) && resp . status ( ) === 200 )
3333 }
3434}
You can’t perform that action at this time.
0 commit comments