Commit e9561b30 authored by Sanad Liaquat's avatar Sanad Liaquat

Merge branch 'e2e-update-group-creation' into 'master'

Create top-level group with non gitlab-qa user

See merge request gitlab-org/gitlab!82141
parents 9cfd5df7 eca6c52f
...@@ -6,21 +6,22 @@ module QA ...@@ -6,21 +6,22 @@ module QA
let(:api_client) { Runtime::API::Client.as_admin } let(:api_client) { Runtime::API::Client.as_admin }
let(:user) do let(:user) do
Resource::User.fabricate_via_api! do |user| Resource::User.fabricate_via_api! do |user|
user.email = "gitlab-qa+#{SecureRandom.hex(2)}@gitlab.com" user.email = "test-user-#{SecureRandom.hex(4)}@gitlab.com"
user.api_client = api_client user.api_client = api_client
user.hard_delete_on_api_removal = true user.hard_delete_on_api_removal = true
end end
end end
let(:group1) do let(:group_for_trial) do
Resource::Sandbox.fabricate! do |sandbox| Resource::Sandbox.fabricate! do |sandbox|
sandbox.path = "gitlab-qa-group-#{SecureRandom.hex(4)}" sandbox.path = "test-group-fulfillment#{SecureRandom.hex(4)}"
sandbox.api_client = api_client sandbox.api_client = api_client
end end
end end
before do before do
group1.add_member(user, Resource::Members::AccessLevel::OWNER) Flow::Login.sign_in(as: user)
group_for_trial.visit!
end end
after do after do
...@@ -29,18 +30,14 @@ module QA ...@@ -29,18 +30,14 @@ module QA
describe 'starts a free trial' do describe 'starts a free trial' do
context 'when on about page with multiple eligible namespaces' do context 'when on about page with multiple eligible namespaces' do
let(:group2) do let!(:group) do
Resource::Sandbox.fabricate! do |sandbox| Resource::Sandbox.fabricate! do |sandbox|
sandbox.path = "gitlab-qa-group-#{SecureRandom.hex(4)}" sandbox.path = "test-group-fulfillment#{SecureRandom.hex(4)}"
sandbox.api_client = api_client sandbox.api_client = api_client
end end
end end
before do before do
group2.add_member(user, Resource::Members::AccessLevel::OWNER)
Flow::Login.sign_in(as: user)
Runtime::Browser.visit(:about, Chemlab::Vendor::GitlabHandbook::Page::About) Runtime::Browser.visit(:about, Chemlab::Vendor::GitlabHandbook::Page::About)
Chemlab::Vendor::GitlabHandbook::Page::About.perform(&:get_free_trial) Chemlab::Vendor::GitlabHandbook::Page::About.perform(&:get_free_trial)
...@@ -48,6 +45,10 @@ module QA ...@@ -48,6 +45,10 @@ module QA
Page::Trials::New.perform(&:visit) Page::Trials::New.perform(&:visit)
end end
after do
group.remove_via_api!
end
it 'registers for a new trial', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347671' do it 'registers for a new trial', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347671' do
register_for_trial register_for_trial
...@@ -60,15 +61,14 @@ module QA ...@@ -60,15 +61,14 @@ module QA
Gitlab::Page::Group::Settings::Billing.perform do |billing| Gitlab::Page::Group::Settings::Billing.perform do |billing|
expect do expect do
billing.billing_plan_header billing.billing_plan_header
end.to eventually_include("#{group1.path} is currently using the Ultimate SaaS Trial Plan").within(max_duration: 120, max_attempts: 60, reload_page: page) end.to eventually_include("#{group_for_trial.path} is currently using the Ultimate SaaS Trial Plan").within(max_duration: 120, max_attempts: 60, reload_page: page)
end end
end end
end end
context 'when on billing page with only one eligible namespace' do context 'when on billing page with only one eligible namespace' do
before do before do
Flow::Login.sign_in(as: user) group_for_trial.visit!
group1.visit!
Page::Group::Menu.perform(&:go_to_billing) Page::Group::Menu.perform(&:go_to_billing)
end end
...@@ -85,7 +85,7 @@ module QA ...@@ -85,7 +85,7 @@ module QA
Gitlab::Page::Group::Settings::Billing.perform do |billing| Gitlab::Page::Group::Settings::Billing.perform do |billing|
expect do expect do
billing.billing_plan_header billing.billing_plan_header
end.to eventually_include("#{group1.path} is currently using the Ultimate SaaS Trial Plan").within(max_duration: 120, max_attempts: 60, reload_page: page) end.to eventually_include("#{group_for_trial.path} is currently using the Ultimate SaaS Trial Plan").within(max_duration: 120, max_attempts: 60, reload_page: page)
end end
end end
end end
...@@ -117,7 +117,7 @@ module QA ...@@ -117,7 +117,7 @@ module QA
unless skip_select unless skip_select
Page::Trials::Select.perform do |select| Page::Trials::Select.perform do |select|
select.subscription_for = group1.path select.subscription_for = group_for_trial.path
select.trial_company select.trial_company
select.start_your_free_trial select.start_your_free_trial
end end
......
...@@ -18,13 +18,13 @@ module QA ...@@ -18,13 +18,13 @@ module QA
let(:group) do let(:group) do
Resource::Sandbox.fabricate! do |sandbox| Resource::Sandbox.fabricate! do |sandbox|
sandbox.path = "gitlab-qa-group-#{hash}" sandbox.path = "test-group-fulfillment#{hash}"
sandbox.api_client = Runtime::API::Client.as_admin sandbox.api_client = Runtime::API::Client.as_admin
end end
end end
before do before do
group.add_member(user, Resource::Members::AccessLevel::OWNER) Flow::Login.sign_in(as: user)
# A group project is required for additional CI Minutes to show up # A group project is required for additional CI Minutes to show up
Resource::Project.fabricate_via_api! do |project| Resource::Project.fabricate_via_api! do |project|
...@@ -34,7 +34,6 @@ module QA ...@@ -34,7 +34,6 @@ module QA
project.api_client = Runtime::API::Client.as_admin project.api_client = Runtime::API::Client.as_admin
end end
Flow::Login.sign_in(as: user)
group.visit! group.visit!
end end
......
...@@ -29,13 +29,13 @@ module QA ...@@ -29,13 +29,13 @@ module QA
let(:group) do let(:group) do
Resource::Sandbox.fabricate! do |sandbox| Resource::Sandbox.fabricate! do |sandbox|
sandbox.path = "gitlab-qa-group-#{hash}" sandbox.path = "test-group-fulfillment#{hash}"
sandbox.api_client = Runtime::API::Client.as_admin sandbox.api_client = Runtime::API::Client.as_admin
end end
end end
before do before do
group.add_member(user, Resource::Members::AccessLevel::OWNER) Flow::Login.sign_in(as: user)
Resource::Project.fabricate_via_api! do |project| Resource::Project.fabricate_via_api! do |project|
project.name = 'storage' project.name = 'storage'
...@@ -44,7 +44,6 @@ module QA ...@@ -44,7 +44,6 @@ module QA
project.api_client = Runtime::API::Client.as_admin project.api_client = Runtime::API::Client.as_admin
end end
Flow::Login.sign_in(as: user)
group.visit! group.visit!
end end
......
...@@ -9,7 +9,7 @@ module QA ...@@ -9,7 +9,7 @@ module QA
let(:hash) { SecureRandom.hex(4) } let(:hash) { SecureRandom.hex(4) }
let(:user) do let(:user) do
Resource::User.fabricate_via_api! do |user| Resource::User.fabricate_via_api! do |user|
user.email = "gitlab-qa+#{hash}@gitlab.com" user.email = "test-user-#{hash}@gitlab.com"
user.api_client = Runtime::API::Client.as_admin user.api_client = Runtime::API::Client.as_admin
user.hard_delete_on_api_removal = true user.hard_delete_on_api_removal = true
end end
...@@ -20,13 +20,12 @@ module QA ...@@ -20,13 +20,12 @@ module QA
# that has a Subscription attached # that has a Subscription attached
let(:group) do let(:group) do
Resource::Sandbox.fabricate! do |sandbox| Resource::Sandbox.fabricate! do |sandbox|
sandbox.path = "gitlab-qa-group-#{hash}" sandbox.path = "test-group-fulfillment#{hash}"
sandbox.api_client = Runtime::API::Client.as_admin sandbox.api_client = Runtime::API::Client.as_admin
end end
end end
before do before do
group.add_member(user, Resource::Members::AccessLevel::OWNER)
Flow::Login.sign_in(as: user) Flow::Login.sign_in(as: user)
group.visit! group.visit!
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment