Skip to content

Commit

Permalink
Merge pull request #3512 from lmorchard/3510-resource-class-tweak
Browse files Browse the repository at this point in the history
Revert "fix(circleci): use default size resources for content-server tests"
  • Loading branch information
lmorchard committed Nov 27, 2019
2 parents f14ad7e + 26d45a7 commit 5984f9a
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 26 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Expand Up @@ -93,6 +93,7 @@ jobs:
- run: ../../.circleci/deploy.sh << parameters.module >>

fxa-content-server:
resource_class: xlarge
parallelism: 6
docker:
- image: mozilla/fxa-circleci
Expand Down
65 changes: 40 additions & 25 deletions packages/fxa-content-server/tests/functional/lib/helpers.js
Expand Up @@ -32,6 +32,7 @@ const SIGNUP_URL = config.fxaContentRoot + 'signup';
const ENABLE_TOTP_URL = `${SETTINGS_URL}/two_step_authentication`;
const UNTRUSTED_OAUTH_APP = config.fxaUntrustedOauthApp;
const TEST_PRODUCT_URL = `${config.fxaContentRoot}subscriptions/products/${config.testProductId}`;
const SUBSCRIPTION_MGMT_URL = `${config.fxaContentRoot}subscriptions`;

/**
* Convert a function to a form that can be used as a `then` callback.
Expand Down Expand Up @@ -2436,31 +2437,45 @@ const destroySessionForEmail = thenify(function(email) {
*/
const subscribeToTestProduct = thenify(function() {
const nextYear = (new Date().getFullYear() + 1).toString().substr(2);
return this.parent
.then(openPage(TEST_PRODUCT_URL, 'div.product-payment'))
.then(getQueryParamValue('device_id'))
.then(deviceId => assert.ok(deviceId))
.then(getQueryParamValue('flow_begin_time'))
.then(flowBeginTime => assert.ok(flowBeginTime))
.then(getQueryParamValue('flow_id'))
.then(flowId => assert.ok(flowId))
.then(type('input[name=name]', 'Testo McTestson'))
.switchToFrame(2)
.then(type('input[name=cardnumber]', '4242 4242 4242 4242'))
.switchToParentFrame()
.end(Infinity)
.switchToFrame(3)
.then(type('input[name=exp-date]', `12${nextYear}`))
.switchToParentFrame()
.end(Infinity)
.switchToFrame(4)
.then(type('.InputElement', '123'))
.switchToParentFrame()
.end(Infinity)
.then(type('input[name=zip]', '12345'))
.then(click('input[type=checkbox]'))
.then(click('button[name=submit]'))
.then(testElementTextEquals('#splash header h1', '123done'));
return (
this.parent
.then(openPage(TEST_PRODUCT_URL, 'div.product-payment'))
.then(getQueryParamValue('device_id'))
.then(deviceId => assert.ok(deviceId))
.then(getQueryParamValue('flow_begin_time'))
.then(flowBeginTime => assert.ok(flowBeginTime))
.then(getQueryParamValue('flow_id'))
.then(flowId => assert.ok(flowId))
.then(type('input[name=name]', 'Testo McTestson'))
.switchToFrame(2)
.then(type('input[name=cardnumber]', '4242 4242 4242 4242'))
.switchToParentFrame()
.end(Infinity)
.switchToFrame(3)
.then(type('input[name=exp-date]', `12${nextYear}`))
.switchToParentFrame()
.end(Infinity)
.switchToFrame(4)
.then(type('.InputElement', '123'))
.switchToParentFrame()
.end(Infinity)
.then(type('input[name=zip]', '12345'))
.then(click('input[type=checkbox]'))
.then(click('button[name=submit]'))
// We want to know that the subscription process has been successfully
// completed without checking for anything product specific
.then(
waitForUrl(
// waitForUrl is a bit unintuitive in that it stops waiting when the
// function returns false
url =>
url.startsWith(config.fxaContentRoot) ||
url.startsWith(config.fxaPaymentsRoot)
)
)
.then(openPage(SUBSCRIPTION_MGMT_URL, '.subscription-management'))
.then(testElementExists('div[data-testid="subscription-item"]'))
);
});

module.exports = {
Expand Down
2 changes: 1 addition & 1 deletion packages/fxa-content-server/tests/intern.js
Expand Up @@ -40,7 +40,7 @@ const asyncTimeout = parseInt(args.asyncTimeout || 5000, 10);
// args.bailAfterFirstFailure comes in as a string.
const bailAfterFirstFailure = args.bailAfterFirstFailure === 'true';

const testProductId = '123doneProProduct';
const testProductId = args.testProductId || '123doneProProduct';

// Intern specific options are here: https://theintern.io/docs.html#Intern/4/docs/docs%2Fconfiguration.md/properties
const config = {
Expand Down

0 comments on commit 5984f9a

Please sign in to comment.