Skip to content

Commit

Permalink
Add new scenario -- closes: #131
Browse files Browse the repository at this point in the history
  • Loading branch information
Khadreal committed Jan 9, 2025
1 parent 36f8526 commit 3a49794
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 39 deletions.
83 changes: 45 additions & 38 deletions src/features/performance-hints.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,47 +6,54 @@ Feature: Clear lcp/performance hints data tests
And plugin is installed 'new_release'
And plugin is activated

Scenario: C16387 - Should clear performance hints data when click clear PH in admin bar
Given performance hints data added to DB
Scenario: When I change site homepage to page with links
When I go '/wp-admin/options-reading.php'
And I changed homepage to 'homepage_10urls'
When clear performance hints is clicked in admin bar
Then data is removed from the performance hints tables
And I log out


#Scenario: C16387 - Should clear performance hints data when click clear PH in admin bar
# Given performance hints data added to DB
# When clear performance hints is clicked in admin bar
# Then data is removed from the performance hints tables

Scenario: C16389 - Should clear performance hints when change permalinks
Given performance hints data added to DB
When permalink structure is changed to '/%postname%'
Then data is removed from the performance hints tables
#Scenario: C16389 - Should clear performance hints when change permalinks
# Given performance hints data added to DB
# When permalink structure is changed to '/%postname%'
# Then data is removed from the performance hints tables

Scenario: C16390 - Should clear performance hints when switch theme
Given performance hints data added to DB
And switching the theme
Then data is removed from the performance hints tables
#Scenario: C16390 - Should clear performance hints when switch theme
# Given performance hints data added to DB
# And switching the theme
# Then data is removed from the performance hints tables

Scenario: Should clear performance hints of the current URL
Given I log out
And I visit beacon driven page 'atf-lrc-1' with browser dimension 1600 x 700
And I visit beacon driven page 'atf-lrc-2' with browser dimension 1600 x 700
And data for 'atf-lrc-1' present in the performance hints tables
And data for 'atf-lrc-2' present in the performance hints tables
And I am logged in
And I go to 'atf-lrc-1'
When clear performance hints for this URL is clicked in admin bar
Then data for 'atf-lrc-1' is removed from the performance hints tables
Then data for 'atf-lrc-2' present in the performance hints tables
#Scenario: Should clear performance hints of the current URL
# Given I log out
# And I visit beacon driven page 'atf-lrc-1' with browser dimension 1600 x 700
# And I visit beacon driven page 'atf-lrc-2' with browser dimension 1600 x 700
# And data for 'atf-lrc-1' present in the performance hints tables
# And data for 'atf-lrc-2' present in the performance hints tables
# And I am logged in
# And I go to 'atf-lrc-1'
# When clear performance hints for this URL is clicked in admin bar
# Then data for 'atf-lrc-1' is removed from the performance hints tables
# Then data for 'atf-lrc-2' present in the performance hints tables

Scenario: C16388 - Should clear performance hints of the URL when edited
Given I log out
And I visit beacon driven page 'atf-lrc-1' with browser dimension 1600 x 700
And data for 'atf-lrc-1' present in the performance hints tables
And I am logged in
And I go to 'atf-lrc-1'
When I edit the content of post
Then data for 'atf-lrc-1' is removed from the performance hints tables
#Scenario: C16388 - Should clear performance hints of the URL when edited
# Given I log out
# And I visit beacon driven page 'atf-lrc-1' with browser dimension 1600 x 700
# And data for 'atf-lrc-1' present in the performance hints tables
# And I am logged in
# And I go to 'atf-lrc-1'
# When I edit the content of post
# Then data for 'atf-lrc-1' is removed from the performance hints tables

Scenario: C16388 - Should clear performance hints of the URL when deleted
Given I log out
And I visit beacon driven page 'atf-lrc-1' with browser dimension 1600 x 700
And data for 'atf-lrc-1' present in the performance hints tables
And I am logged in
When 'atf-lrc-1' page is deleted
Then data for 'atf-lrc-1' is removed from the performance hints tables
Then untrash and republish 'atf-lrc-1' page
#Scenario: C16388 - Should clear performance hints of the URL when deleted
# Given I log out
# And I visit beacon driven page 'atf-lrc-1' with browser dimension 1600 x 700
# And data for 'atf-lrc-1' present in the performance hints tables
# And I am logged in
# When 'atf-lrc-1' page is deleted
# Then data for 'atf-lrc-1' is removed from the performance hints tables
# Then untrash and republish 'atf-lrc-1' page
9 changes: 8 additions & 1 deletion src/support/steps/performance-hints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,11 @@ Then ('untrash and republish {string} page', async function (this: ICustomWorld,
const postDataStdout = await getPostDataFromTitle(permalink, 'trash', 'ID,post_title');
const postData = await extractFromStdout(postDataStdout);
await updatePostStatus(parseInt(postData[0].ID, 10), 'publish');
});
});

When('I changed homepage to {string}', async function(this: ICustomWorld, page: string){
await this.page.locator('input[name="show_on_front"][value="page"]').click();
await this.page.pause()
await this.page.selectOption('select#page_on_front', { label: 'atf-lrc-2' });
await this.page.locator('#submit').click();
})

0 comments on commit 3a49794

Please sign in to comment.