Skip to content

Commit

Permalink
Merge branch 'development' into USH-1200
Browse files Browse the repository at this point in the history
  • Loading branch information
Angamanga committed Sep 17, 2024
2 parents 634f84a + 996b3a5 commit 353ddc0
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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() {
Expand Down
7 changes: 2 additions & 5 deletions e2e-testing/cypress/e2e/6-posts/posts.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
});
14 changes: 9 additions & 5 deletions e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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() {
Expand All @@ -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');
Expand All @@ -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();
Expand Down

0 comments on commit 353ddc0

Please sign in to comment.