Skip to content
This repository has been archived by the owner on Feb 18, 2021. It is now read-only.

Skip domains tests if domain registration is unavailable #1373

Merged
merged 10 commits into from
Aug 1, 2018

Conversation

Stojdza
Copy link
Contributor

@Stojdza Stojdza commented Jul 26, 2018

Check if domain registration is available, and skip tests if it's not.

To test wp-manage-domains-spec:

  • change this line in Calypso to if ( this.state.domainRegistrationAvailable ) {
  • run tests against that Calypso
  • domain registration should be unavailable

To test wp-signup-spec:
NOTE: This includes only Sign up for a site on a business paid plan w/ domain name coming in via /create as business flow in CAD currency @parallel test.

  • Change blocks of this and this functions to:
this.showValidationErrorMessage( domain, 'domain_registration_unavailable', {
     	maintenanceEndTime: null,
} );
  • run tests against that Calypso
  • domain registration should be unavailable

Result: Tests should be skipped and not failed.

Additional changes: Sign up for a domain only purchase coming in from wordpress.com/domains in EUR currency @parallel - Now it opens /domains page and searches for a domain instead opening direct link for a wanted .live domain. This was needed to be done because we will add check for domain registration unavailability in the future.

Fixes #1308

@Stojdza Stojdza self-assigned this Jul 26, 2018
@Stojdza Stojdza requested a review from a team July 26, 2018 17:23
Copy link
Contributor

@bsessions85 bsessions85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and passes with and without domains working in local testing.

Copy link
Contributor

@alisterscott alisterscott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you be able to include this in the sign up tests also that rely on domains? These will also fail when domains are unavailable. Thanks

@alisterscott
Copy link
Contributor

Thanks for the update @Stojdza!

The manage domains spec works well 👍

env BROWSERSIZE=desktop ./node_modules/.bin/mocha specs/wp-manage-domains-spec.js 


  [WPCOM] Managing Domains: (desktop) @parallel
    Adding a domain to an existing site 
      ✓ Log In and Select Domains (9482ms)
      ✓ Can see the Domains page and choose add a domain (1984ms)
SKIPPING: Domain registration is currently unavailable. 
      - Can see the domain search component
      - Can search for a blog name
      - Can select the .com search result and decline Google Apps for email
      - Can see checkout page, choose privacy and enter registrar details
      - Can then see secure payment component
      - Empty the cart
    Map a domain to an existing site @parallel
      ✓ Log In and Select Domains (8555ms)
      ✓ Can see the Domains page and choose add a domain (2250ms)
      - Can see the domain search component
      - Can select to use an existing domain
      - Can see use my own domain page
      - Can select to buy domain mapping
      - Can see enter a domain component
      - Can enter the domain name
      - Can add domain to the cart
      - Can see checkout page
      - Empty the cart
    Transfer a domain to an existing site (partial) @parallel
      - Log In and Select Domains
      - Can see the Domains page and choose add a domain
      - Can see the domain search component
      - Can select to use an existing domain
      - Can see use my own domain page
      - Can select to transfer a domain
      - Can see the transfer my domain page
      - Can enter the domain name
      - Click transfer domain button
      - Can see the transfer precheck page
      - Can enter auth code on the transfer precheck page
      - Click check auth code
      - Can see auth code error


  4 passing (1m)
  28 pending

With the sign up spec; I couldn't get this to fail because the step still shows just doesn't show paid results:

screen shot 2018-07-30 at 2 07 41 pm

So I was thinking for the sign up tests that register a paid domain only, we could maybe just check the existence of the info message on that screen and abort those tests. The sign up tests that use free wordpress.com addresses don't need to be updated AFAIK

Copy link
Contributor

@alisterscott alisterscott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments

@@ -93,7 +94,17 @@ describe( `[${ host }] Sign Up (${ screenSize }, ${ locale })`, function() {
step(
'Can then see the domains page, and Can search for a blog name, can see and select a free .wordpress address in the results',
async function() {
const findADomainComponent = await FindADomainComponent.Expect( driver );
let findADomainComponent;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to check for unavailability as this uses a free wordpress.com address which doesn't depend on the domains service

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. I'll add checking only for paid domains and remove these.

@alisterscott
Copy link
Contributor

@Stojdza you'll need to rebase or merge master into this since #1342 has landed which made some changes to the sign up spec

@Stojdza
Copy link
Contributor Author

Stojdza commented Jul 31, 2018

Thanks for this notice @alisterscott, I'll merge it.

@Stojdza
Copy link
Contributor Author

Stojdza commented Jul 31, 2018

I've added changes for signup spec and update PR description.

@alisterscott
Copy link
Contributor

Sorry I didn't get to review this today - @bsessions85: would you mind re-reviewing the latest updates?

@bsessions85
Copy link
Contributor

This is looking good to me. I'm curious as to why we're not adding the check in Sign up for a domain only purchase coming in from wordpress.com/domains in EUR currency @parallel now. If domains goes down, this test will still fail.

@Stojdza
Copy link
Contributor Author

Stojdza commented Aug 1, 2018

@bsessions85 For now there is no way to test it locally, and because of that I left TODO

@bsessions85
Copy link
Contributor

🚢

@Stojdza Stojdza merged commit 419aeca into master Aug 1, 2018
@Stojdza Stojdza deleted the add/check-unavailable-registration branch August 1, 2018 19:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants