Skip to content

E2E test: check for code suggestion error in webide test

Jay McCure requested to merge jmc-improve-cs-wedide-error-message into master

What does this MR do and why?

In #440242 (closed) code suggestions failed, but the error is not clear as an empty alert is open when this occurs. An alert is present when code suggestions fail. Rather than failing with an empty alert, it's preferred to fail with an error stating that code suggestions failed and get the error message from the UI.

skip_finished_loading_check_on_refresh had to be used as finished_all_ajax_requests will fail when there is an alert present.

Example of error before change: https://gitlab.com/gitlab-org/gitlab/-/jobs/6080458289#L493 Test passing in this MR: https://gitlab.com/gitlab-org/gitlab/-/jobs/6093065248#L416

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

To simulate a code suggestion error:

  1. Add breakpoint after https://gitlab.com/gitlab-org/gitlab/-/blob/5adec204bb3ab9d3c185985e456d5251fc725286/qa/qa/page/project/web_ide/vscode.rb#L248-248

  2. Run test against staging:

GITLAB_QA_USER_AGENT=1P GITLAB_USERNAME=gitlab-qa GITLAB_PASSWORD=1P GITLAB_QA_ACCESS_TOKEN=1P QA_GITLAB_URL=https://staging.gitlab.com bundle exec rspec qa/specs/features/ee/browser_ui/3_create/web_ide/code_suggestions_in_web_ide_spec.rb
  1. Turn off wifi (this will cause a code suggestion error)

  2. Resume test.

  3. Error should be improved.

Edited by Jay McCure

Merge request reports