You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The interface for Feed Edit is pretty chaotic for the automated browser. Some click events might not trigger all interactions, thus making the test fail.
In both Playwright and Cypress, when using fields made with Tagify, the values will not be saved in the input. Thus, we need a separate function to inject the value into the input.
Example of E2E that we should have for it
test('changing General Feed Settings',async({ editor, page })=>{constimportName='Test Title: changing General Feed Settings';awaitpage.goto('/wp-admin/post-new.php?post_type=feedzy_imports');awaittryCloseTourModal(page);awaitpage.getByPlaceholder('Add a name for your import').fill(importName);awaitaddFeeds(page,[FEED_URL]);awaitpage.getByRole('button',{name: 'Step 4 General feed settings'}).click({force: true});// Change duplicated items setting.constduplicatedItemsDefault=awaitpage.getByLabel('Remove Duplicate Items').isChecked();awaitpage.getByLabel('Remove Duplicate Items').click();awaitexpect(page.getByLabel('Remove Duplicate Items').isChecked()).resolves.toBe(!duplicatedItemsDefault);// Change item counts setting.awaitpage.locator('#feedzy_item_limit').fill('3');awaitexpect(page.locator('#feedzy_item_limit').inputValue()).resolves.toBe('3');awaitpage.getByRole('button',{name: 'Save & Activate importing'}).click({force: true});awaitrunFeedImport(page);awaitexpect(page.locator('#ui-id-1').locator('li a').count()).resolves.toBe(3);});test('chained actions for feed content',async({ editor, page, admin })=>{awaitpage.setViewportSize({width: 1920,height: 1080,});constimportName='Test Title: changing General Feed Settings';awaitpage.goto('/wp-admin/post-new.php?post_type=feedzy_imports');awaittryCloseTourModal(page);awaitpage.getByPlaceholder('Add a name for your import').fill(importName);awaitaddFeeds(page,[FEED_URL]);awaitpage.getByRole('button',{name: 'Step 3 Map content'}).click({force: true});awaitpage.getByRole('button',{name: 'Insert Tag'}).nth(2).click({force: true});awaitpage.getByRole('link',{name: 'Item Content [#item_content]'}).click({force: true});// Add the first action.awaitpage.getByRole('button',{name: 'Add new'}).click({force: true});awaitpage.getByText('Trim Content').click({force: true});awaitexpect(page.getByRole('button',{name: 'Trim Content'})).toBeVisible();awaitpage.getByRole('button',{name: 'Trim Content'}).click({force: true});awaitpage.getByPlaceholder('45').fill('10');// Add the second action.awaitpage.getByRole('button',{name: 'Add new'}).click({force: true});awaitpage.getByText('Search / Replace').click({force: true});awaitpage.getByRole('button',{name: 'Search and Replace'}).click({force: true});awaitpage.getByLabel('Search').fill('Lorem');awaitpage.getByLabel('Replace with').fill('Ipsum');awaitpage.getByRole('list').getByRole('button').nth(1).click({force: true});// Delete the first action.awaitexpect(page.getByRole('button',{name: 'Trim Content'})).toBeHidden();awaitpage.getByRole('button',{name: 'Save Actions'}).click({force: true});awaitexpect(page.getByRole('heading',{name: 'Add actions to this tag'})).toBeHidden();// The modal is closed.awaitexpect(page.getByTitle('item content').getByRole('link')).toBeVisible();// The action tag is added.// Save the serialized actions in the input field.constcontentItemTagData=awaitpage.locator('tag[title="item content"] .tagify__filter-icon').getAttribute('value');awaitpage.evaluate((contentItemTagData)=>{document.querySelector('[name="feedzy_meta_data[import_post_content]"]').value=`[[{"value": "${contentItemTagData}"}]]`;},contentItemTagData);awaitpage.getByRole('button',{name: 'Save',exact: true}).click({force: true});awaitpage.waitForSelector('#the-list',{timeout: 5000});consteditLink=awaitpage.locator('#the-list .row-actions .edit a').first().getAttribute('href');awaitpage.goto(editLink);awaitpage.getByRole('button',{name: 'Step 3 Map content'}).click({force: true});awaitpage.getByTitle('remove tag').click({force: true});awaitexpect(page.getByText('item content',{exact: true})).toBeHidden();});test('chained actions for feed title ',async({ editor, page, admin })=>{awaitpage.setViewportSize({width: 1920,height: 1080,});constimportName='Test Title: changing General Feed Settings';awaitpage.goto('/wp-admin/post-new.php?post_type=feedzy_imports');awaittryCloseTourModal(page);awaitpage.getByPlaceholder('Add a name for your import').fill(importName);awaitaddFeeds(page,[FEED_URL]);awaitpage.getByRole('button',{name: 'Step 3 Map content'}).click({force: true});awaitpage.locator('span').filter({hasText: '[#item_title]'}).clear();awaitpage.getByRole('button',{name: 'Insert Tag'}).first().click({force: true});awaitpage.getByRole('link',{name: 'Item Title [#item_title]'}).click({force: true});// Add the first action.awaitpage.getByRole('button',{name: 'Add new'}).click({force: true});awaitpage.getByText('Trim Content').click({force: true});awaitexpect(page.getByRole('button',{name: 'Trim Content'})).toBeVisible();awaitpage.getByRole('button',{name: 'Trim Content'}).click({force: true});awaitpage.getByPlaceholder('45').fill('10');// Add the second action.awaitpage.getByRole('button',{name: 'Add new'}).click({force: true});awaitpage.getByText('Search / Replace').click({force: true});awaitpage.getByRole('button',{name: 'Search and Replace'}).click({force: true});awaitpage.getByLabel('Search').fill('Lorem');awaitpage.getByLabel('Replace with').fill('Ipsum');awaitpage.getByRole('button',{name: 'Save Actions'}).click({force: true});awaitexpect(page.getByText('item title',{exact: true})).toBeVisible();// The action tag is added.// Save the serialized actions in the input field.consttitleItemTagData=awaitpage.locator('tag[title="item title"] .tagify__filter-icon').getAttribute('value');awaitpage.evaluate((titleItemTagData)=>{document.querySelector('[name="feedzy_meta_data[import_post_title]"]').value=`[[{"value": "${titleItemTagData}"}]]`;},titleItemTagData);awaitpage.getByRole('button',{name: 'Save',exact: true}).click({force: true});awaitpage.waitForSelector('#the-list',{timeout: 5000});consteditLink=awaitpage.locator('#the-list .row-actions .edit a').first().getAttribute('href');awaitpage.goto(editLink);awaitpage.getByRole('button',{name: 'Step 3 Map content'}).click({force: true});awaitpage.getByTitle('remove tag').click({force: true});awaitexpect(page.getByText('item title',{exact: true})).toBeHidden();});
The text was updated successfully, but these errors were encountered:
Problem
The interface for Feed Edit is pretty chaotic for the automated browser. Some click events might not trigger all interactions, thus making the test fail.
In both Playwright and Cypress, when using fields made with Tagify, the values will not be saved in the input. Thus, we need a separate function to inject the value into the input.
Example of E2E that we should have for it
The text was updated successfully, but these errors were encountered: