Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

[MM-26477] E2E tests and fixes for Cloud Onboarding - sysadmin #6269

Merged
merged 8 commits into from
Aug 27, 2020

Conversation

devinbinnie
Copy link
Member

@devinbinnie devinbinnie commented Aug 25, 2020

Summary

Collection of E2E tests for the Cloud Onboarding - Sysadmin feature.
Also some fixes/changes needed to support those tests.

Will be adding another for the menu item once this PR is merged: #6276

Ticket Link

https://mattermost.atlassian.net/browse/MM-26477

@devinbinnie devinbinnie added 2: Dev Review Requires review by a core commiter 3: QA Review Requires review by a QA tester labels Aug 25, 2020
Copy link
Member

@jwilander jwilander left a comment

Choose a reason for hiding this comment

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

Looks really good 👍

cy.wrap(clipboard).its('link').should('eq', inviteLink);
});
});
});
Copy link
Member

Choose a reason for hiding this comment

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

@devinbinnie Do we have TM4J for each test case? If none, I can help create TM4J test cases. Please let me know, thanks

Copy link
Member Author

@devinbinnie devinbinnie Aug 26, 2020

Choose a reason for hiding this comment

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

@saturninoabril That depends on what TM4J is 😆

EDIT: After a quick Google no we don't. Let's get those made, let me know what I need to do :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Cases have been added to JIRA

Copy link
Member

@saturninoabril saturninoabril left a comment

Choose a reason for hiding this comment

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

@devinbinnie Thanks for creating test cases in TM4J. I was not able to run yet as I needed a license with Cloud feature but left quick comments. Will get back to this once again.

@@ -0,0 +1,421 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
Copy link
Member

Choose a reason for hiding this comment

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

I suggests to move this into a new folder - e2e/cypress/integration/cloud/onboarding - to match with the folder structure in TM4J.

before(() => {
// # Check if with license and has matching database
cy.apiRequireLicenseForFeature('Cloud');
cy.requireServerDBToMatch();
Copy link
Member

Choose a reason for hiding this comment

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

I wonder why this spec needs to match server DB. Is there somewhere where it needs direct query to DB?

Copy link
Member Author

Choose a reason for hiding this comment

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

Nope, I thought this was something I might need. Will remove.

* Happy Path
*/

it('Cloud Onboarding - Full Flow', () => {
Copy link
Member

Choose a reason for hiding this comment

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

Please change title to [tm4j_id] [title/description] so that we'll be able to save each test result into the TM4J automatically.

Example:

it('MM-T3326 Sysadmin - Happy Path', () => {


before(() => {
// # Check if with license and has matching database
cy.apiRequireLicenseForFeature('Cloud');
Copy link
Member

Choose a reason for hiding this comment

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

Where can I get a license with Cloud feature?

cy.url().should('include', townSquarePage);

// * Check to make sure card is expanded
cy.get('.Card__body.expanded .CompleteProfileStep').should('be.visible');
Copy link
Member

Choose a reason for hiding this comment

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

I think the last option is the CSS selector but can this be converted using queries from testing-library?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure what you mean by this, did you want me to query it a different way? I don't think there's anything wrong with using the CSS selector, since there won't be any other elements with this particular path.

Copy link
Member

Choose a reason for hiding this comment

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

I agree. It's only something to improve for testing. Use of selector like this is susceptible to change and closer to implementation details rather than how the user actually sees it.
One approach might be to verify content which could represent that the body is expanded, like

cy.findByText('Enter your name').should('be.visible');

this.setState({copiedLink: document.execCommand('copy')});
} catch (err) {
this.setState({copiedLink: false});
const clipboard = navigator.clipboard;
Copy link
Member

Choose a reason for hiding this comment

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

FYI, there's Utils.copyToClipboard that does this as a helper, but it currently doesn't do the navigator.clipboard bit we talked about yesterday, so you'd have to wait for my PR to use that. You could use the current version for the textarea case at least if you wanted though.

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, depending when your PR gets in I can update that in your PR/as a seperate one later. Definitely something I can do though.


testWithConfig({
ServiceSettings: {
ExperimentalChannelSidebarOrganization: 'default_on',
Copy link
Member

Choose a reason for hiding this comment

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

Do you specifically need the new sidebar for this? If so, we might want to talk about getting that pushed to default_on for others since we haven't really discussed that on our side recently.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, the sidebar module is only for the new sidebar (which I assume is what we're going to launch with Cloud). But yeah that's what I'm hoping for.

I think it can be turned on for the other sidebar if need be though, I'll bring it up in the Cloud meeting today to determine the plan.

@hmhealey hmhealey removed the 2: Dev Review Requires review by a core commiter label Aug 27, 2020
Copy link
Member

@saturninoabril saturninoabril left a comment

Choose a reason for hiding this comment

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

@devinbinnie Tested and passed. Cypress tests are all consistently passing for me. Left comments but not blocking. Just something to consider in the future. Also thanks for adding test cases to Jira!

cy.findByTestId('PictureSelector__input-CompleteProfileStep__profilePicture').attachFile('mattermost-icon.png');

// # Click Save profile button
cy.findByTestId('CompleteProfileStep__saveProfileButton').should('be.visible').should('not.be.disabled').click();
Copy link
Member

Choose a reason for hiding this comment

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

This could be,

cy.findByText('Save profile').should('be.visible').and('not.be.disabled').click();

@saturninoabril saturninoabril added 4: Reviews Complete All reviewers have approved the pull request and removed 3: QA Review Requires review by a QA tester labels Aug 27, 2020
@devinbinnie devinbinnie merged commit dd9c5fa into mattermost:feature/cloud-onboarding Aug 27, 2020
devinbinnie added a commit that referenced this pull request Aug 27, 2020
* [MM-26468][MM-26483] Progress Bar Common Component/Sidebar Next Steps Component (#5865)

* [MM-26483] Progress bar common component and PoC in the sidebar

* Styling for the sidebar element and some tests

* Added translations

* Snapshot update

* Style changes

* Use same border design as channels

* [MM-26465] Background and general layout for cloud onboarding (#5823)

* WIP

* WIP

* [MM-26465] Background and general layout for cloud onboarding

* Mobile view, lint and type fixes, added a test file for later use

* More test fixes

* UX feedback

* Replaced dumb comment with useful one

* Turn off graphic at 1020px

* Lint fix

* Update copy

* PR feedback

Co-authored-by: Mattermod <[email protected]>

* [MM-26480] Card/Accordion Common Component (#5861)

* WIP

* WIP

* [MM-26465] Background and general layout for cloud onboarding

* Mobile view, lint and type fixes, added a test file for later use

* More test fixes

* UX feedback

* Replaced dumb comment with useful one

* Turn off graphic at 1020px

* WIP

* Initial card style

* Collapse functionality (no animation)

* WIP

* Rest of accordion common component and some animation

* Lint, type and test fixes

* Updated snapshot

* Reduce nesting

* Merge'd

* PR feedback

* Fix box-shadow on collapsed state

* [MM-26470] Base Next Step Wizard Controller and Styling (#5893)

* WIP

* WIP

* [MM-26465] Background and general layout for cloud onboarding

* Mobile view, lint and type fixes, added a test file for later use

* More test fixes

* UX feedback

* Replaced dumb comment with useful one

* Turn off graphic at 1020px

* WIP

* Initial card style

* Collapse functionality (no animation)

* WIP

* Rest of accordion common component and some animation

* Lint, type and test fixes

* Updated snapshot

* Reduce nesting

* WIP - Wiring for step wizard

* Skip getting started link, hook for final page

* Moved steps into its own constants file, type and test fixes

* Shifted around the screen changing and added final screen placeholder

* Translations and wizard navigation button styling

* Pick starting step based on which are finished, button styling fixes

* Allow for getting out of next steps view by switching channels

* PR feedback

* PR feedback

* blank

* Change style of complete card header to be more like the regular one

* Fixed background on complete step

* Merge'd

* PR feedback

* PR feedback

* Removed translation

* Fixed box shadow transition on card

* Removed duplicate logic

* PR feedback

* PR feedback

* Fixed hover state on completed cards

* re-add margin on complete state

* [MM-26466] Close Next Steps Modal and functionality (#5995)

* Hooked up the sidebar next steps bar and some fixes

* Integration of state into app for next steps view, close next steps view modal preliminary

* Styling and help arrow for modal

* Missed a translation

* PR feedback

* Center the next steps modal

* PR feedback

* Translation fix

* [MM-27164] Picture Selector Common Component (#5973)

* WIP

* WIP

* [MM-26465] Background and general layout for cloud onboarding

* Mobile view, lint and type fixes, added a test file for later use

* More test fixes

* UX feedback

* Replaced dumb comment with useful one

* Turn off graphic at 1020px

* WIP

* Initial card style

* Collapse functionality (no animation)

* WIP

* Rest of accordion common component and some animation

* Lint, type and test fixes

* Updated snapshot

* Reduce nesting

* WIP - Wiring for step wizard

* Skip getting started link, hook for final page

* Moved steps into its own constants file, type and test fixes

* Shifted around the screen changing and added final screen placeholder

* Translations and wizard navigation button styling

* Pick starting step based on which are finished, button styling fixes

* Allow for getting out of next steps view by switching channels

* PR feedback

* PR feedback

* blank

* Change style of complete card header to be more like the regular one

* Fixed background on complete step

* Merge'd

* PR feedback

* PR feedback

* Removed translation

* Fixed box shadow transition on card

* Removed duplicate logic

* WIP

* Functional component that works

* Styling and a couple tweaks

* A few tests

* Snapshots

* Type and i18n fixes

* PR feedback and test fixes

* Added button hover states

* PR feedback

* Blur select button on select image

* Blur on click, not on select image

* Update components/picture_selector.tsx

Co-authored-by: Nev Angelova <[email protected]>

Co-authored-by: Nev Angelova <[email protected]>

* [MM-26482] Textbox Common Component for Cloud Onboarding (#5904)

* WIP

* WIP

* [MM-26465] Background and general layout for cloud onboarding

* Mobile view, lint and type fixes, added a test file for later use

* More test fixes

* UX feedback

* Replaced dumb comment with useful one

* Turn off graphic at 1020px

* WIP

* Initial card style

* Collapse functionality (no animation)

* WIP

* Rest of accordion common component and some animation

* Lint, type and test fixes

* Updated snapshot

* Reduce nesting

* WIP - Wiring for step wizard

* Skip getting started link, hook for final page

* Moved steps into its own constants file, type and test fixes

* Shifted around the screen changing and added final screen placeholder

* Translations and wizard navigation button styling

* Pick starting step based on which are finished, button styling fixes

* Allow for getting out of next steps view by switching channels

* PR feedback

* WIP

* [MM-26472] Textbox Common Component for Cloud Onboarding

* Specific styling for the Cloud Onboarding components

* Added info component and some other styling

* Fixed the error styling

* Fixed most of the shifting in the textbox

* Lint fix

* PR feedback

* blank

* PR feedback

* Change style of complete card header to be more like the regular one

* Fixed background on complete step

* Merge'd

* PR feedback

* PR feedback

* Removed translation

* PR feedback

* Use box shadow instead of border for changing text input

* Improved CSS from Asaad

* Removed inner border when focused/error state

* Removed unnecessary commented code

* Merge'd

* Switch to proper BEM

* [MM-26469] Complete Profile Step (#6077)

* [MM-26469] Complete Profile Step

* Lint fix

* [MM-26473] Tips and Next Steps screen (#6020)

* Screen transitions for loading screen and final screen

* Transition screen

* Fixed APNG issue

* Style for desktop and mobile

* Fixed styling

* More fixes

* Functionality and test fixes

* Dev PR feedback

* UX PR feedback

* UX feedback

* Merge'd

Co-authored-by: Mattermod <[email protected]>

* [MM-26471] Team Profile Setup step (#6083)

* [MM-26471] Team Profile Setup step

* Translation fix

* PR feedback

* Fixed an issue with an older version of the styles

* Removed commented code

* [MM-26472] Invite Members step (#6143)

* WIP

* WIP

* [MM-26742] Functionality for Invite Members step, and most of styling

* Beginning of common component, currently for use only in the Invite Members step

* Cleanup

* Couple small style fixes

* Fixed the invite link at the bottom

* Lint and test fixes

* PR feedback

* Fixed button width for copy link and fixed test

* [MM-27908] Updated Cloud Logo (#6190)

* [MM-27908] Updated Cloud Logo

* Remove extra prop

* Type fix

* [MM-27907] Fixed input focus colour and fixed placeholder focus on multi_input (#6182)

* [MM-27907] Fixed input focus colour and fixed placeholder focus on multi_input

* PR feedback

* [MM-27159] Button States for Cloud Onboarding (#6189)

* [MM-27159] Button States

* PR feedback

* [MM-27305] Card Component Refactor for smoothness  (#6172)

* Refactor Card component to be more responsive and robust

* Cleanup and a couple other bug fixes

* [MM-27974] Unit Tests for Cloud Onboarding (#6208)

* [MM-27974] Unit Tests for Cloud Onboarding

* Translation fix

* [MM-27923] Turn on Cloud Onboarding for Cloud-only instances (#6225)

* [MM-28099] Menu Item to return to Getting Started (#6276)

* [MM-28099] Menu Item to return to Getting Started

* Translation fix

* Test fixes

* [MM-28107] Refactor MoreChannels and NewChannelsFlow modals and add them to next_steps_tips (#6279)

* [MM-28107] Refactor MoreChannels and NewChannelsFlow modals and add them to next_steps_tips

* Translation fix

* Test and type fixes

* More test fixes

* [MM-26477] E2E tests and fixes for Cloud Onboarding - sysadmin (#6269)

* [MM-26477] E2E tests and fixes for Cloud Onboarding - sysadmin

* Changed copy link method and added test for Copy Invite Link

* Snapshot update

* Test including the Getting started menu item

* PR feedback

* Quick fix

Co-authored-by: Mattermod <[email protected]>
Co-authored-by: Nev Angelova <[email protected]>
@amyblais amyblais added Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation labels Aug 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
4: Reviews Complete All reviewers have approved the pull request Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation
Projects
None yet
5 participants