diff --git a/apps/web-mzima-client/src/app/settings/data-export/data-export.component.ts b/apps/web-mzima-client/src/app/settings/data-export/data-export.component.ts index db3acef856..be83bf2310 100644 --- a/apps/web-mzima-client/src/app/settings/data-export/data-export.component.ts +++ b/apps/web-mzima-client/src/app/settings/data-export/data-export.component.ts @@ -94,7 +94,14 @@ export class DataExportComponent implements OnInit { exportAll() { this.pollingService .startExport({ send_to_hdx: false, include_hxl: false, send_to_browser: true }) - .subscribe(); + .subscribe({ + next: () => { + this.loadExportJobs(); + }, + error: (err) => { + console.error('Export failed: ', err); + }, + }); } selectAll(form: FormInterface) { @@ -129,7 +136,14 @@ export class DataExportComponent implements OnInit { }); this.pollingService .startExport({ fields, send_to_hdx: false, include_hxl: false, send_to_browser: true }) - .subscribe(); + .subscribe({ + next: () => { + this.loadExportJobs(); + }, + error: (err) => { + console.error('Export failed: ', err); + }, + }); } selectFields() { diff --git a/e2e-testing/cypress/e2e/6-posts/posts.cy.js b/e2e-testing/cypress/e2e/6-posts/posts.cy.js index 610ee1ec90..1f916e7aaa 100644 --- a/e2e-testing/cypress/e2e/6-posts/posts.cy.js +++ b/e2e-testing/cypress/e2e/6-posts/posts.cy.js @@ -15,19 +15,16 @@ describe('Automated Tests for Posts', () => { postFunctions.fill_required_form_fields(); postFunctions.complete_add_post_steps(); postFunctions.verify_created_post_exists(); - }); - - it.skip('Verifies post details', () => { - postFunctions.open_post_for_details(); postFunctions.verify_post_details(); }); + it('Changes and verifies status of a post', () => { postFunctions.open_post_creation_form(); postFunctions.fill_required_form_fields(); postFunctions.complete_add_post_steps(); postFunctions.change_post_status(); }); - it.skip('Deletes a post', () => { + it('Deletes a post', () => { postFunctions.delete_post(); }); }); diff --git a/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js b/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js index 45ad2435a3..47ad9264f9 100644 --- a/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js +++ b/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js @@ -63,7 +63,8 @@ class PostFunctions { cy.get(PostLocators.postPreview) .children(PostLocators.postItem) .contains(this.postTitle) - .should('be.visible'); + .should('be.visible') + .click(); } open_post_for_details() { @@ -72,7 +73,7 @@ class PostFunctions { cy.get(DataViewLocators.revealFiltersBtn).click(); cy.get(DataViewLocators.clearFiltersBtn).click(); - cy.get(PostLocators.postItem).eq(0).click(); + cy.get(PostLocators.postItem).eq(0).click({ force: true }); } verify_post_details() { @@ -83,7 +84,8 @@ class PostFunctions { //verify survey fields cy.get(PostLocators.titleValue).should('contain', 'Automated Title Response'); cy.get(PostLocators.descriptionValue).should('contain', 'Automated Description Response'); - cy.contains('Automated Short text').scrollIntoView().should('be.visible'); + cy.get('[data-qa="posts"] > :nth-child(2)').scrollTo('bottom'); + // cy.contains('Automated Short text').scrollIntoView().should('be.visible'); cy.contains('This is an automated long text response').should('be.visible'); cy.contains(99.9).should('be.visible'); cy.contains(100).should('be.visible'); @@ -99,10 +101,12 @@ class PostFunctions { cy.get(DataViewLocators.revealFiltersBtn).click(); cy.get(DataViewLocators.clearFiltersBtn).click(); - //select post + //verify post count to verify we are in correct post page cy.get('[data-qa="feed-page-results"]').contains('Current results: 20 / 518'); cy.contains(this.postTitle).scrollIntoView(); - cy.contains(this.postTitle).click(); + + //change post to be deleted to "New Post Title for Location" + cy.contains(this.postTitle).click({ force: true }); //delete post cy.get(PostLocators.postMenuDots).eq(0).click();