Commit 511b2b27 authored by eugielimpin's avatar eugielimpin

Add :trial_focused variant to :logged_out_marketing_header experiment

This variant introduces the following changes to the experimental
header shown when there is no logged in user:
- Display a "Get a free trial" button as the main CTA button
- Like the candidate variant, sign up and login buttons are separate
parent ccf068e5
......@@ -426,7 +426,9 @@ module ApplicationHelper
return if current_user
experiment(:logged_out_marketing_header, actor: nil) do |e|
e.candidate { 'logged-out-marketing-header-candidate' }
html_class = 'logged-out-marketing-header-candidate'
e.candidate { html_class }
e.try(:trial_focused) { html_class }
e.control {}
e.run
end
......
......@@ -26,6 +26,8 @@
- experiment(:logged_out_marketing_header, actor: nil) do |e|
- e.candidate do
= render 'layouts/header/marketing_links'
- e.try(:trial_focused) do
= render 'layouts/header/marketing_links'
- e.control do
.gl-display-none.gl-sm-display-block
= render "layouts/nav/top_nav"
......@@ -117,6 +119,9 @@
- e.candidate do
%li.nav-item.gl-display-none.gl-sm-display-block
= render "layouts/nav/top_nav"
- e.try(:trial_focused) do
%li.nav-item.gl-display-none.gl-sm-display-block
= render "layouts/nav/top_nav"
- e.control {}
- if header_link?(:user_dropdown)
%li.nav-item.header-user.js-nav-user-dropdown.dropdown{ data: { track_label: "profile_dropdown", track_action: "click_dropdown", track_value: "", qa_selector: 'user_menu' }, class: ('mr-0' if has_impersonation_link) }
......@@ -138,6 +143,14 @@
%li.nav-item.gl-display-none.gl-sm-display-block
= link_to _('Login'), new_session_path(:user, redirect_to_referer: 'yes')
= render 'layouts/header/sign_in_register_button', class: 'gl-sm-display-none'
- e.try(:trial_focused) do
%li.nav-item.gl-display-none.gl-sm-display-block
= link_to _('Get a free trial'), 'https://about.gitlab.com/free-trial/', class: 'gl-button btn btn-default btn-sign-in'
%li.nav-item.gl-display-none.gl-sm-display-block
= link_to _('Sign up'), new_user_registration_path
%li.nav-item.gl-display-none.gl-sm-display-block
= link_to _('Login'), new_session_path(:user, redirect_to_referer: 'yes')
= render 'layouts/header/sign_in_register_button', class: 'gl-sm-display-none'
- e.control do
= render 'layouts/header/sign_in_register_button'
......
......@@ -16040,6 +16040,9 @@ msgstr ""
msgid "Get a free instance review"
msgstr ""
msgid "Get a free trial"
msgstr ""
msgid "Get a support subscription"
msgstr ""
......
......@@ -20,6 +20,21 @@ RSpec.describe 'User sees experimental lmarketing header' do
end
end
context 'when experiment candidate (trial focused variant)' do
it 'shows marketing header links', :aggregate_failures do
stub_experiments(logged_out_marketing_header: :trial_focused)
visit project_path(project)
expect(page).to have_text "About GitLab"
expect(page).to have_text "Pricing"
expect(page).to have_text "Talk to an expert"
expect(page).to have_text "Get a free trial"
expect(page).to have_text "Sign up"
expect(page).to have_text "Login"
end
end
context 'when experiment control' do
it 'does not show marketing header links', :aggregate_failures do
stub_experiments(logged_out_marketing_header: :control)
......@@ -31,6 +46,8 @@ RSpec.describe 'User sees experimental lmarketing header' do
expect(page).not_to have_text "Talk to an expert"
expect(page).not_to have_text "Sign up now"
expect(page).not_to have_text "Login"
expect(page).not_to have_text "Get a free trial"
expect(page).not_to have_text "Sign up"
expect(page).to have_text "Sign in / Register"
end
end
......
......@@ -498,6 +498,12 @@ RSpec.describe ApplicationHelper do
it { is_expected.to include(expected_class) }
end
context 'when candidate (:trial_focused variant)' do
let(:variant) { :trial_focused }
it { is_expected.to include(expected_class) }
end
context 'when control' do
let(:variant) { :control }
......
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