Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closes #176: Backstop tests not working as expected for LLCSSBG & LRC tests when run generally #179

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/features/ll-css-bg-image-double-colon.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Feature: C14626 - Should lazyload CSS background images inside internal, and ext
And I save settings 'media' 'lazyloadCssBgImg'

Scenario: Open the page template and compare to nowprocket
Given visual regression reference is generated
Then I must not see any visual regression 'doubleColon'
Then I must not see any error in debug.log
When I log out
Expand Down
3 changes: 2 additions & 1 deletion src/features/ll-css-bg-image-elementor.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
Feature: C14412 - Should be compatible with Elementor background

Scenario: Enable LL BG Images and check page template
Given I am logged in
Given visual regression reference is generated
And I am logged in
And plugin is installed 'new_release'
And plugin is activated
When I go to 'wp-admin/options-general.php?page=wprocket#dashboard'
Expand Down
3 changes: 2 additions & 1 deletion src/features/ll-css-bg-image-fallback-js-disabled.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
Feature: C13977 - Should have a fallback for browsers where JavaScript is disabled

Scenario: Open the page template and compare to nowprocket with javascript disabled
Given I am logged in
Given visual regression reference is generated
And I am logged in
And plugin is installed 'new_release'
And plugin is activated
When I go to 'wp-admin/options-general.php?page=wprocket#dashboard'
Expand Down
1 change: 1 addition & 0 deletions src/features/ll-css-bg-image-single-colon.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Feature: C14626 - Should lazyload CSS background images inside internal, and ext
And I save settings 'media' 'lazyloadCssBgImg'

Scenario: Open the page template and compare to nowprocket
Given visual regression reference is generated
Then I must not see any visual regression 'singleColon'
Then I must not see any error in debug.log
When I log out
Expand Down
1 change: 1 addition & 0 deletions src/features/ll-css-bg-image.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Feature: C13969 - Should lazyload CSS background images inside internal, and ext
And I save settings 'media' 'lazyloadCssBgImg'

Scenario: Open the page template and compare to nowprocket
Given visual regression reference is generated
Then I must not see any visual regression 'llcss'
Then I must not see any error in debug.log
When I log out
Expand Down
1 change: 1 addition & 0 deletions src/features/lrc-visual-regression.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Feature: LRC Visual Regression Test on Live Template
And I go to 'wp-admin/options-general.php?page=wprocket#dashboard'

Scenario: Shouldn't have any visual regression when visiting
Given visual regression reference is generated
When I log out
And I visit scenario urls
And I am logged in
Expand Down
2 changes: 2 additions & 0 deletions src/features/wpml-compatibility.feature
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ Feature: C14655 - Should LL Background work on main/sub language
And wpml directory is enabled

Scenario: Open the page with directory lanaguage
When I log out
Then no error in the console different than nowprocket page 'lazyload_css_background_images'
When switch to another language
Then I must not see any error in debug.log

Scenario: Change WPML to query string option
Given wpml query string is enabled
When I log out
Then no error in the console different than nowprocket page 'lazyload_css_background_images'
When switch to another language
Then I must not see any error in debug.log
12 changes: 12 additions & 0 deletions src/support/steps/general.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,16 @@ Given('theme {string} is activated', async function (this:ICustomWorld, theme) {
Given('visual regression reference is generated', async function (this:ICustomWorld) {
const tags = this.pickle.tags.map(tag => tag.name);
const tag: string = await getScenarioTag(tags);

// Array of tags to exclude from one time reference generation.
const exclusion = [
'@delayjs'
]

// Bail out if there is already reference for the current tag.
if (process.env.scenario_tag === tag && !exclusion.includes(tag)) {
return;
}

try {
await batchUpdateVRTestUrl({
Expand All @@ -131,6 +141,8 @@ Given('visual regression reference is generated', async function (this:ICustomWo
} catch (error) {
console.error('Backstop reference generation failed: ', error.message);
}

process.env.scenario_tag = tag;
});

/**
Expand Down