Skip to content

E2E: Migrate Slack Pages and Tests from Chemlab

Valerie Burton requested to merge e2e-migrate-slack-specs-from-chemlab into master

What does this MR do and why?

As part of Migrate Chemlab E2E Tests in the GitLab Project Back to The GitLab E2E Framework, this MR:

  • Migrates the following page classes from Chemlab to the GitLab E2E test framework:
    • Slack::Page::Chat -> QA::Vendor::Slack::Page::Chat
    • Slack::Page::Login -> QA::Vendor::Slack::Page::Login
    • Slack::Page::OAuth -> QA::Vendor::Slack::Page::OAuth
    • Page::Profile::ChatNames::New
    • Page::Project::Settings::Services::Slack
  • Adds new data-testids authorize-button and install-slack-app-button for non-vendor pages
  • Migrates the Slack::Mixins::GitlabApp Mixin from Chemlab to QA::Vendor::Slack::Mixins::GitlabApp in the GitLab E2E test framework
  • Creates a new QA::Vendor::Slack::Address module to store the Slack base URL
  • Updates QA::Flow::Integrations::Slack to use the new page classes
  • Updates the spec browser_ui/1_manage/integrations/slash_commands_spec.rb to use the updated code
  • Removes the following Chemlab related files:
    • qa/lib/slack/mixins/browser.rb
    • qa/lib/slack.rb

Closes the following issues:

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

Please note: This test was originally configured to only run against Staging Ref

If you would like to run this test against Staging Ref, please follow the instructions below:

  1. Log out of Slack on your local machine.
  2. Export the following ENV variables to your terminal.
    • The 1Password values for GITLAB_PASSWORD and GITLAB_QA_ACCESS_TOKEN can be found in the Staging Ref credentials entry in the Engineering vault. The remaining 1Password values can be found in the E2E Slack Test Credentials entry in the Gitlab-QA vault.
GITLAB_USERNAME=gitlab-qa
GITLAB_PASSWORD=<1Password>
WEBDRIVER_HEADLESS=false
QA_GITLAB_URL=https://staging-ref.gitlab.com
QA_SLACK_EMAIL=<1Password>
QA_SLACK_PASSWORD=<1Password>
QA_SLACK_WORKSPACE=<1Password>
GITLAB_QA_ACCESS_TOKEN=<1Password>
  1. Replace the following methods that interact with the new data-testids added in this MR, since they do not exist on Staging Ref yet:
    • In QA::Page::Project::Settings::Services::Slack, replace click_element('install-slack-app-button') with find('a', text: /install GitLab for Slack app/i).click
    • In QA::Page::Profile::ChatNames::New, replace click_element('authorize-button') with find('button', text: /Authorize/i).click.
  2. cd to qa directory and run the following command:
bundle exec rspec qa/specs/features/browser_ui/1_manage/integrations/slash_commands_spec.rb
Edited by Valerie Burton

Merge request reports