-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds e2e test for Enterprise Newsletter (#3595)
* add publisher script to show newsletter from available interventions * add e2e test for enterprise newsletter * update title and text * remove wait statements * try not strict equality ont ype * add print statements * add print statements * fix return * add contribution to see if it will render * debug * remove bad screenshots * debug more * debug * revert * fix show call * delete bad screenshot * remove console statement * fix baseline path for ss * update config to upload baseline too, add enterprise screenshots --------- Co-authored-by: justinchou-google <justinchou-google@users.noreply.github.com>
- Loading branch information
1 parent
fe798b1
commit 8383e70
Showing
10 changed files
with
130 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/** | ||
* Copyright 2019 The Subscribe with Google Authors. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS-IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
'use strict'; | ||
|
||
const {swgPageUrl} = require('../util'); | ||
|
||
/** | ||
* @fileoverview Page object for the basic contribution page. | ||
*/ | ||
const commands = { | ||
viewNewsletter: function () { | ||
return this.pause(1000) | ||
.log('Viewing newsletter') | ||
.switchToFrame('[src*="about:blank"]', 'SwG outer iFrame') | ||
.switchToFrame('[src*="newsletteriframe"]', 'SwG inner iFrame'); | ||
}, | ||
consentToNewsletter: function () { | ||
return this.log('Checking consent checkbox').click('@consentCheckbox'); | ||
}, | ||
optInAction: function () { | ||
return this.log('Clicking opt in button').click('@optInButton'); | ||
}, | ||
}; | ||
|
||
module.exports = { | ||
url: function () { | ||
return swgPageUrl( | ||
this.api.launchUrl, | ||
'/examples/sample-pub/config/rrme-contributions-prod/1?showNewsletterSignup', | ||
this.api.globals.swg_experiments | ||
); | ||
}, | ||
commands: [commands], | ||
elements: { | ||
consentCheckbox: { | ||
selector: '.MlG5Jc input', | ||
}, | ||
consentMessage: { | ||
selector: '.MlG5Jc label', | ||
}, | ||
newsletterHeader: { | ||
selector: '.sJIgh', | ||
}, | ||
optInButton: { | ||
selector: '.C2qNIf button', | ||
}, | ||
swgDialog: { | ||
selector: '.swg-dialog', | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/** | ||
* Copyright 2019 The Subscribe with Google Authors. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS-IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
module.exports = { | ||
'@tags': ['enterprise'], | ||
|
||
'Enterprise Newsletter': (browser) => { | ||
const basic = browser.page.enterpriseNewsletter(); | ||
basic | ||
.navigate() | ||
.pause(3000) | ||
.assert.screenshotIdenticalToBaseline('html', 'enterprise-newsletter') | ||
.viewNewsletter() | ||
.assert.textContains( | ||
'@newsletterHeader', | ||
'Enterprise Contribution E2E Test Pub' | ||
) | ||
.assert.textContains('@consentMessage', 'I consent to this newsletter.') | ||
.consentToNewsletter() | ||
.optInAction() | ||
.checkSignIn() | ||
.end(); | ||
}, | ||
}; |
File renamed without changes
File renamed without changes
Binary file added
BIN
+121 KB
test/e2e/vrt/baseline/chrome_linux/basicNewsletter/basic-newsletter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+121 KB
...t/baseline/chrome_linux/basicNewsletter/basic-newsletter_all_experiments_on.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+591 KB
test/e2e/vrt/baseline/chrome_linux/enterpriseNewsletter/enterprise-newsletter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+591 KB
.../chrome_linux/enterpriseNewsletter/enterprise-newsletter_all_experiments_on.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.