JoinColony / colonyDapp

Colony dApp client
49 stars 19 forks source link

E2E Test the Claim Username Workflow #917

Closed rdig closed 5 years ago

rdig commented 5 years ago

As it says on the tin: write a cypress spec that tests the whole Claim Username workflow

Testing

It should cover:

Best practices

Please note that, as a best practice, prefer to add a new data-test attribute, to hook onto components, rather then relying on elements/class/ids selectors and filtering from there.

Example:

/*
 * Component (not the actual one, simplified)
 */
const AvatarDropdown = () => (
  <Popover ... >
    <button
      ...
      data-test="avatarDropdown"
    />
  </Popover>
);

/*
 * Test (not the actual one, simplified)
 */
it('Open the Claim Username flow', () => {
  ...
  cy.get('button[data-test="avatarDropdown"]').click();
  ...
});

See this example spec: https://github.com/JoinColony/colonyDapp/blob/master/cypress/integration/claim-username.js

Resources

A couple of resources to help you along you're journey:

karolinkas commented 5 years ago

@rdig This one has been resolved in: https://github.com/JoinColony/colonyDapp/pull/1186/files I will close them together.