Skip to content

Commit

Permalink
release: fixes
Browse files Browse the repository at this point in the history
Improvements
- Allow chained actions for `[#item_title]`
- Added floating widget to the dashboard
- Made item_date tag to respect and convert to site timezone on import
- Updated internal dependencies

Fixes
- Fix `auto` option for default fallback image in Feedzy RSS Block.
- Fixed issue when images with non-Latin characters in the URL are not imported
- Fixed issue with fallback image per import job not working [PRO]
- Fixed usage of custom tag for featured image in the import settings [PRO]
  • Loading branch information
vytisbulkevicius authored May 30, 2024
2 parents eced321 + 794270e commit e57b1b4
Show file tree
Hide file tree
Showing 19 changed files with 552 additions and 137 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ cypress/videos/*
cypress/screenshots/*
cypress/integration/localhost*
cypress/fixtures
cypress.env.json
cypress.env.json
.phpunit.result.cache
121 changes: 87 additions & 34 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,7 @@ module.exports = defineConfig({
specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}',
pageLoadTimeout : 300000,
},
blockHosts: [
'app.formbricks.com'
],
})
84 changes: 72 additions & 12 deletions cypress/e2e/default/import_feed_free.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,72 @@ describe('Test Free - Import Feed', function() {
cy.get('.fz-tabs-menu li a').should('have.length', settings.tabs);
})

it('Create/Verify/Run import', function() {
it('Check chained actions insertion for title', function() {
// Create a new import.
cy.visit('/wp-admin/post-new.php?post_type=feedzy_imports');

// Fill up the form
cy.get('#post_title').clear().type( 'Chained actions: ' + feed.url );
cy.get('#feedzy-import-source').clear().type( feed.url );
cy.get('#feedzy-import-source').next('.fz-input-group-append').find('.add-outside-tags').click();

// Open the Map Content tab
cy.get('#fz-import-map-content > .feedzy-accordion-item__button').click();

// Clear the title field.
cy.get(':nth-child(4) > .fz-right > .fz-form-group > .fz-input-group > .fz-input-group-left > .fz-group > .tagify > .tagify__input').type('{selectall}{backspace}');

// Add chained actions for title field.
cy.get(':nth-child(4) > .fz-right > .fz-form-group > .fz-input-group > .fz-input-group-right > .dropdown > .btn').click();
cy.get(':nth-child(4) > .fz-right > .fz-form-group > .fz-input-group > .fz-input-group-right > .dropdown > .dropdown-menu > [data-field-tag="item_title"] > small').click(); // Select the [#item_title] tag.

// Add a chained action.
cy.get('.fz-action-relative > .components-button').click();
cy.get('.popover-action-list > ul > :nth-child(1)').click(); // Select the "Trim content" action.

// Add another chained action.
cy.get('.fz-action-relative > .components-button').click();
cy.get('.popover-action-list > ul > :nth-child(3)').click(); // Select the "Search and Replace" action.

// Save actions.
cy.get('.fz-save-action').click();

// Save the serialized data directly to the input field. (The Tagify lib used for UI does not update the input field based on Cypress click actions).
cy.get('.tagify__input > .tagify__tag a').invoke('attr', 'data-actions').then((serializedActions) => {
cy.get('[name="feedzy_meta_data[import_post_title]"]').clear({force: true}).invoke('val', '[[{"value": "' + serializedActions + '"}]]' ).blur({force: true});
});

// Save the import.
cy.get('button[type="submit"][name="save"]').scrollIntoView().click({force:true});

// Reopen the import.
cy.visit('/wp-admin/edit.php?post_type=feedzy_imports');
cy.get('tr:nth-of-type(1) .row-title').click();

// Open the Map Content tab
cy.get('#fz-import-map-content > .feedzy-accordion-item__button').click();

// Check the saved actions.
cy.get('.tagify__input > .tagify__tag').should('be.visible');
cy.get('.tagify__input > .tagify__tag a').invoke('attr', 'data-actions').then((serializedActions) => {
expect(serializedActions).to.include('item_title');
expect(serializedActions).to.include('trim');
expect(serializedActions).to.include('search_replace');

// Check if we have right actions.
const actions = JSON.parse(decodeURIComponent(serializedActions));

expect(actions).to.have.length(2);
expect(actions[0].id).to.equal('trim');
expect(actions[0].tag).to.equal('item_title');

expect(actions[1].id).to.equal('search_replace');
expect(actions[1].tag).to.equal('item_title');
} );

})

it('Check the Create/Verify/Run workflow for feed import', function() {
// 1. CREATE
cy.visit('/wp-admin/post-new.php?post_type=feedzy_imports');

Expand Down Expand Up @@ -54,7 +119,7 @@ describe('Test Free - Import Feed', function() {

cy.get('[name="feedzy_meta_data[import_post_title]"]').clear({force: true}).invoke('val', PREFIX + feed.title).blur({force: true});
cy.get('[name="feedzy_meta_data[import_post_content]"]').clear({force: true}).invoke('val', PREFIX + feed.fullcontent.content + feed.content).blur({force: true});
cy.get('[name="feedzy_meta_data[import_post_featured_img]"]').clear({force: true}).invoke('val', feed.image.url).blur({force: true});
cy.get('[name="feedzy_meta_data[import_post_featured_img]"]').clear({force: true}).invoke('val', feed.image.tag).blur({force: true});

// check disallowd magic tags
const tags = feed.tags.disallowed;
Expand Down Expand Up @@ -84,18 +149,15 @@ describe('Test Free - Import Feed', function() {

// show a notice.
//cy.get('div.notice.feedzy-error-critical').should('be.visible');
})

it('Update the new import with VALID url', function() {

cy.visit('/wp-admin/edit.php?post_type=feedzy_imports');

cy.get('tr:nth-of-type(1) .row-title').click();


// fill up the form
cy.get('#post_title').clear().type( feed.url );
cy.get('#feedzy-import-source').clear().type( feed.url );
cy.get('#feedzy-import-source').next('.fz-input-group-append').find('.add-outside-tags').click();


cy.get('button[type="submit"][name="save"]').scrollIntoView().click({force:true});

// check if the import has been setup
Expand All @@ -117,12 +179,12 @@ describe('Test Free - Import Feed', function() {
cy.get('#feedzy_post_terms').invoke('show').then( () => {
cy.get('#feedzy_post_terms option:selected').should('have.length', feed.taxonomy.length);
});

cy.get('[name="feedzy_meta_data[import_post_title]"]').should('have.value', PREFIX + feed.title);
cy.get('[name="feedzy_meta_data[import_post_content]"]').should('have.value', PREFIX + feed.fullcontent.content + feed.content + '\n');

// image from URL
cy.get('[name="feedzy_meta_data[import_post_featured_img]"]').should('have.value', feed.image.url);
cy.get('[name="feedzy_meta_data[import_post_featured_img]"]').should('have.value', feed.image.tag);

// publish
cy.get('button[type="submit"][name="publish"]').scrollIntoView().click({force:true});
Expand Down Expand Up @@ -254,6 +316,4 @@ describe('Test Free - Import Feed', function() {
cy.get('.wp-block-post-author-name .wp-block-post-author-name__link:contains("wordpress")').should('exist');

})


})
Loading

0 comments on commit e57b1b4

Please sign in to comment.