E2E test for adding new file in webide
Description of the test
E2E test for adding new file in web ide, this spec cover two tests
- Adding a existing file, throws error
- Adding a new file adds successfully and is visible in the project
Screenshots or screen recordings
Output
[0:09:48] gitlab/qa [master]$ bundle exec rspec ./qa/specs/features/browser_ui/3_create/web_ide/add_first_file_in_web_ide_spec.rb warning: parser/current is loading parser/ruby30, which recognizes 3.0.6-compliant syntax, but you are running 3.0.5. Please see https://github.com/whitequark/parser#compatibility-with-ruby-mri. 2023-11-25 00:14:46 / CONF :: ==> Base URL: http://gdk.test:3000 ==> Browser: # ==> Libraries: Chemlab::VendorRandomized with seed 26714 [Nov 25 2023 00:14:46 IST (QA Tests)] INFO -- Caching token for username: root, last six chars of token:4yTPx4 [Nov 25 2023 00:14:46 IST (QA Tests)] INFO -- Using Browser: chrome [Nov 25 2023 00:14:46 IST (QA Tests)] INFO -- Performing sanity check for environment! [Nov 25 2023 00:14:47 IST (QA Tests)] INFO -- Disabling sync with External package metadata database [Nov 25 2023 00:14:48 IST (QA Tests)] INFO -- Setting application settings: {:package_metadata_purl_types=>[11]}
Create Add first file in Web IDE when user adds a new file [Nov 25 2023 00:14:48 IST (QA Tests)] INFO -- Starting test: Create Add first file in Web IDE when user adds a new file shows successfully added and visible in project [Nov 25 2023 00:14:48 IST (QA Tests)] INFO -- filling :username-field with "root" [Nov 25 2023 00:14:48 IST (QA Tests)] INFO -- clicking the coordinates of :username-field [Nov 25 2023 00:14:48 IST (QA Tests)] INFO -- filling :password-field with "" [Nov 25 2023 00:14:48 IST (QA Tests)] INFO -- clicking the coordinates of :password-field [Nov 25 2023 00:14:49 IST (QA Tests)] INFO -- clicking :sign-in-button [Nov 25 2023 00:14:52 IST (QA Tests)] WARN -- Potentially Slow Code 'click_element sign-in-button' took 3.401s [Nov 25 2023 00:14:54 IST (QA Tests)] INFO -- ==> Retrieved a QA::Resource::Sandbox with full_path 'gitlab-qa-sandbox-group-7' via api in 0.12 seconds [Nov 25 2023 00:14:55 IST (QA Tests)] INFO -- ==> Built a QA::Resource::Group with full_path 'gitlab-qa-sandbox-group-7/qa-test-2023-11-25-00-14-54-2980c3231a9e67ea' via api in 0.99 seconds [Nov 25 2023 00:14:57 IST (QA Tests)] INFO -- Visiting QA::Resource::Project at http://gdk.test:3000/gitlab-qa-sandbox-group-7/qa-test-2023-11-25-00-14-54-2980c3231a9e67ea/webide-create-file-project-b81ad940c1a18a0b [Nov 25 2023 00:15:00 IST (QA Tests)] INFO -- clicking :action-dropdown [Nov 25 2023 00:15:01 IST (QA Tests)] INFO -- clicking :webide-menu-item [Nov 25 2023 00:15:07 IST (QA Tests)] WARN -- Potentially Slow Code 'has_element? broadcast-notification-container' took 6.049s [Nov 25 2023 00:15:07 IST (QA Tests)] INFO -- clicking :li[title='New File...'] [Nov 25 2023 00:15:07 IST (QA Tests)] INFO -- clicking :.scm-viewlet-label [Nov 25 2023 00:15:08 IST (QA Tests)] INFO -- clicking :div[aria-label="Commit to 'main'"] [Nov 25 2023 00:15:08 IST (QA Tests)] INFO -- clicking :.monaco-button[title="Continue"] [Nov 25 2023 00:15:19 IST (QA Tests)] WARN -- Potentially Slow Code 'has_element? .span[title="Success! Your changes have been committed."]' took 11.026s [Nov 25 2023 00:15:19 IST (QA Tests)] INFO -- Visiting QA::Resource::Project at http://gdk.test:3000/gitlab-qa-sandbox-group-7/qa-test-2023-11-25-00-14-54-2980c3231a9e67ea/webide-create-file-project-b81ad940c1a18a0b shows successfully added and visible in project when a file with the same name already exists [Nov 25 2023 00:15:21 IST (QA Tests)] INFO -- Starting test: Create Add first file in Web IDE when a file with the same name already exists throws an error [Nov 25 2023 00:15:22 IST (QA Tests)] INFO -- filling :username-field with "root" [Nov 25 2023 00:15:22 IST (QA Tests)] INFO -- clicking the coordinates of :username-field [Nov 25 2023 00:15:22 IST (QA Tests)] INFO -- filling :password-field with "" [Nov 25 2023 00:15:22 IST (QA Tests)] INFO -- clicking the coordinates of :password-field [Nov 25 2023 00:15:23 IST (QA Tests)] INFO -- clicking :sign-in-button [Nov 25 2023 00:15:25 IST (QA Tests)] WARN -- Potentially Slow Code 'click_element sign-in-button' took 2.084s [Nov 25 2023 00:15:26 IST (QA Tests)] INFO -- ==> Retrieved a QA::Resource::Sandbox with full_path 'gitlab-qa-sandbox-group-7' via api in 0.1 seconds [Nov 25 2023 00:15:26 IST (QA Tests)] INFO -- ==> Retrieved a QA::Resource::Group with full_path 'gitlab-qa-sandbox-group-7/qa-test-2023-11-25-00-14-54-2980c3231a9e67ea' via api in 0.21 seconds [Nov 25 2023 00:15:28 IST (QA Tests)] INFO -- Visiting QA::Resource::Project at http://gdk.test:3000/gitlab-qa-sandbox-group-7/qa-test-2023-11-25-00-14-54-2980c3231a9e67ea/webide-create-file-project-7bd45f5d8ca418a0 [Nov 25 2023 00:15:30 IST (QA Tests)] INFO -- clicking :action-dropdown [Nov 25 2023 00:15:30 IST (QA Tests)] INFO -- clicking :webide-menu-item [Nov 25 2023 00:15:37 IST (QA Tests)] WARN -- Potentially Slow Code 'has_element? broadcast-notification-container' took 6.147s [Nov 25 2023 00:15:37 IST (QA Tests)] INFO -- clicking :li[title='New File...'] throws an error
Top 2 slowest examples (49.6 seconds, 96.6% of total time): Create Add first file in Web IDE when user adds a new file shows successfully added and visible in project 33.6 seconds ./qa/specs/features/browser_ui/3_create/web_ide/add_first_file_in_web_ide_spec.rb:31 Create Add first file in Web IDE when a file with the same name already exists throws an error 16 seconds ./qa/specs/features/browser_ui/3_create/web_ide/add_first_file_in_web_ide_spec.rb:18
Finished in 51.34 seconds (files took 3.04 seconds to load) 2 examples, 0 failures
Randomized with seed 26714
How to set up and validate locally
From the qa
directory:
bundle install
export WEBDRIVER_HEADLESS=false # If you'd like to watch the test in action
export QA_GITLAB_URL="http://gdk.test:3000" # Only needed if GDK is not running on http://127.0.0.1:3000
bundle exec rspec ./qa/specs/features/browser_ui/3_create/web_ide/add_first_file_in_web_ide_spec.rb
Checklist
-
Confirm the test has a testcase:
tag linking to an existing test case in the test case project. -
Note if the test is intended to run in specific scenarios. If a scenario is new, add a link to the MR that adds the new scenario. -
Follow the end-to-end tests style guide and best practices. -
Use the appropriate RSpec metadata tag(s). - Most resources will be cleaned up via the general cleanup task. Check that is successful, or ensure resources are cleaned up in the test:
-
New resources have api_get_path
andapi_delete_path
implemented if possible. -
If any resource cannot be deleted in the general delete task, make sure it is ignored. -
If any resource cannot be deleted in the general delete task, remove it in the test (e.g., in an after
block).
-
-
Ensure that no transient bugs are hidden accidentally due to the usage of waits
andreloads
. -
Verify the tags to ensure it runs on the desired test environments. -
If this MR has a dependency on another MR, such as a GitLab QA MR, specify the order in which the MRs should be merged. -
(If applicable) Create a follow-up issue to document the special setup necessary to run the test: ISSUE_LINK -
If the test requires an admin's personal access token, ensure that the test passes on your local environment with and without the GITLAB_QA_ADMIN_ACCESS_TOKEN
provided.