FEATURE: enable full page login by default (#31771)

This switches the signup/login UI to the full page experience by
default. This has been in use by many sites for multiple months and we
have ironed out many fixes in the meantime.

The `full_page_login` setting is also marked for removal in about
1.5mths, by the end of April 2025.
This commit is contained in:
Penar Musaraj
2025-03-25 13:43:51 -04:00
committed by GitHub
parent 8fc2b74bf0
commit 6aaddcf381
28 changed files with 157 additions and 134 deletions
@@ -186,11 +186,10 @@ export default class SignupPageController extends Controller {
return this.passwordValidation.ok || this.passwordValidation.reason;
}
@discourseComputed("usernameValidation.reason")
showUsernameInstructions(usernameValidationReason) {
get showUsernameInstructions() {
return (
this.siteSettings.show_signup_form_username_instructions &&
!usernameValidationReason
!this.usernameValidation.reason
);
}
@@ -23,13 +23,11 @@ acceptance("Auth Complete", function (needs) {
assert.strictEqual(
currentRouteName(),
"discovery.latest",
"it stays on the homepage"
"signup",
"it goes to the signup page"
);
assert
.dom(".d-modal.create-account")
.exists("it shows the registration modal");
assert.dom(".signup-fullpage").exists("it shows the signup page");
});
test("when login required", async function (assert) {
@@ -38,13 +36,11 @@ acceptance("Auth Complete", function (needs) {
assert.strictEqual(
currentRouteName(),
"login",
"it redirects to the login page"
"signup",
"it redirects to the signup page"
);
assert
.dom(".d-modal.create-account")
.exists("it shows the registration modal");
assert.dom(".signup-fullpage").exists("it shows the signup page");
});
test("Callback added using addBeforeAuthCompleteCallback", async function (assert) {
@@ -64,9 +60,5 @@ acceptance("Auth Complete", function (needs) {
"discovery.categories",
"The function added via API was run and it transitioned to 'discovery.categories' route"
);
assert
.dom(".d-modal.create-account")
.doesNotExist("registration modal is not shown");
});
});
@@ -28,9 +28,7 @@ acceptance("Create Account - external auth", function (needs) {
test("when skip is disabled (default)", async function (assert) {
await visit("/");
assert
.dom(".d-modal.create-account")
.exists("it shows the registration modal");
assert.dom(".signup-fullpage").exists("it shows the signup page");
assert.dom("#new-account-username").exists("it shows the fields");
@@ -43,9 +41,7 @@ acceptance("Create Account - external auth", function (needs) {
this.siteSettings.auth_skip_create_confirm = true;
await visit("/");
assert
.dom(".d-modal.create-account")
.exists("it shows the registration modal");
assert.dom(".signup-fullpage").exists("it shows the signup page");
assert
.dom("#new-account-username")
@@ -64,9 +60,7 @@ acceptance("Create account - with associate link", function (needs) {
test("displays associate link when allowed", async function (assert) {
await visit("/");
assert
.dom(".d-modal.create-account")
.exists("it shows the registration modal");
assert.dom(".signup-fullpage").exists("it shows the signup page");
assert.dom("#new-account-username").exists("it shows the fields");
assert
.dom(".create-account-associate-link")
@@ -7,7 +7,8 @@ acceptance("Create Account Fields - From Login Form", function () {
await visit("/");
await click("header .login-button");
await fillIn("#login-account-name", "isaac@foo.com");
await click(".d-modal__footer #new-account-link");
await click("#new-account-link");
assert.dom("#new-account-username").hasText("");
assert
@@ -19,7 +20,7 @@ acceptance("Create Account Fields - From Login Form", function () {
await visit("/");
await click("header .login-button");
await fillIn("#login-account-name", "isaac");
await click(".d-modal__footer #new-account-link");
await click("#new-account-link");
assert.dom("#new-account-email").hasText("");
assert
@@ -15,7 +15,7 @@ acceptance("Create Account", function () {
await visit("/");
await click("header .sign-up-button");
assert.dom(".create-account").exists("it shows the create account modal");
assert.dom(".signup-fullpage").exists("it shows the signup page");
await fillIn("#new-account-name", "Dr. Good Tuna");
await fillIn("#new-account-password", "cool password bro");
@@ -30,7 +30,7 @@ acceptance("Create Account", function () {
assert
.dom("#username-validation.bad")
.exists("the username validation is bad");
await click(".d-modal__footer .btn-primary");
await click(".signup-fullpage .btn-primary");
await fillIn("#new-account-username", "good-tuna");
assert
@@ -47,9 +47,9 @@ acceptance("Create Account", function () {
return response({ success: true });
});
await click(".d-modal__footer .btn-primary");
await click(".signup-fullpage .btn-primary");
assert
.dom(".d-modal__footer .btn-primary")
.dom(".signup-fullpage .btn-primary")
.isDisabled("create account is disabled");
assert.verifySteps(["request"]);
@@ -60,7 +60,7 @@ acceptance("Create Account", function () {
await click("header .sign-up-button");
await fillIn("#new-account-email", "z@z.co");
await click(".d-modal__footer .btn-primary");
await click(".signup-fullpage .btn-primary");
assert
.dom("#username-validation")
@@ -98,9 +98,10 @@ acceptance("Create Account", function () {
.hasText(i18n("user.name.instructions_required"));
await fillIn("#new-account-email", "z@z.co");
await fillIn("#new-account-username", "");
await fillIn("#new-account-password", "supersecurepassword");
await click(".d-modal__footer .btn-primary");
await click(".signup-fullpage .btn-primary");
assert.dom("#username-validation").hasText(i18n("user.username.required"));
@@ -129,7 +130,7 @@ acceptance("Create Account", function () {
await click("header .sign-up-button");
assert
.dom(".d-modal.create-account .btn-primary")
.dom(".signup-fullpage .btn-primary")
.exists("create account button exists");
assert.dom(".passkey-login-button").doesNotExist();
@@ -149,7 +150,7 @@ acceptance("Create Account - full name requirement", function () {
await fillIn("#new-account-username", "good-tuna");
await fillIn("#new-account-password", "cool password bro");
await click(".d-modal__footer .btn-primary");
await click(".signup-fullpage .btn-primary");
assert.dom("#fullname-validation").hasText(i18n("user.name.required"));
await fillIn("#new-account-name", "Full Name");
@@ -164,9 +165,9 @@ acceptance("Create Account - full name requirement", function () {
return response({ success: true });
});
await click(".d-modal__footer .btn-primary");
await click(".signup-fullpage .btn-primary");
assert
.dom(".d-modal__footer .btn-primary")
.dom(".signup-fullpage .btn-primary")
.isDisabled("create account is disabled");
assert.verifySteps(["request"]);
@@ -195,9 +196,9 @@ acceptance("Create Account - full name requirement", function () {
return response({ success: true });
});
await click(".d-modal__footer .btn-primary");
await click(".signup-fullpage .btn-primary");
assert
.dom(".d-modal__footer .btn-primary")
.dom(".signup-fullpage .btn-primary")
.isDisabled("create account is disabled");
assert.verifySteps(["request"]);
@@ -226,9 +227,9 @@ acceptance("Create Account - full name requirement", function () {
return response({ success: true });
});
await click(".d-modal__footer .btn-primary");
await click(".signup-fullpage .btn-primary");
assert
.dom(".d-modal__footer .btn-primary")
.dom(".signup-fullpage .btn-primary")
.isDisabled("create account is disabled");
assert.verifySteps(["request"]);
@@ -1,5 +1,5 @@
import EmberObject from "@ember/object";
import { click, fillIn, triggerKeyEvent, visit } from "@ember/test-helpers";
import { click, fillIn, visit } from "@ember/test-helpers";
import { test } from "qunit";
import { withPluginApi } from "discourse/lib/plugin-api";
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
@@ -55,10 +55,10 @@ acceptance("Create Account - User Fields", function (needs) {
await visit("/");
await click("header .sign-up-button");
assert.dom(".create-account").exists("it shows the create account modal");
assert.dom(".signup-fullpage").exists("it shows the signup page");
assert.dom(".user-field").exists("it has at least one user field");
await click(".d-modal__footer .btn-primary");
await click(".signup-fullpage .btn-primary");
assert
.dom("#account-email-validation")
.hasText(i18n("user.email.required"));
@@ -75,20 +75,10 @@ acceptance("Create Account - User Fields", function (needs) {
.dom("#account-email-validation.good")
.exists("the email validation is good");
await click(".d-modal__footer .btn-primary");
await click(".signup-fullpage .btn-primary");
await fillIn(".user-field input[type=text]:nth-of-type(1)", "Barky");
await click(".user-field input[type=checkbox]");
await click(".d-modal__footer .btn-primary");
});
test("can submit with enter", async function (assert) {
await visit("/");
await click("header .sign-up-button");
await triggerKeyEvent("#new-account-email", "keydown", "Enter");
assert
.dom("#account-email-validation")
.hasText(i18n("user.email.required"), "hitting Enter triggers action");
await click(".signup-fullpage .btn-primary");
});
test("shows validation error for user fields", async function (assert) {
@@ -98,7 +88,7 @@ acceptance("Create Account - User Fields", function (needs) {
await fillIn("#new-account-password", "cool password bro");
await fillIn(".user-field-whats-your-dad-like input", "cool password bro");
await click(".d-modal__footer .btn-primary");
await click(".signup-fullpage .btn-primary");
assert
.dom(".user-field-what-is-your-pets-name .tip.bad")
@@ -125,7 +115,7 @@ acceptance("Create Account - User Fields", function (needs) {
"it does not show error message until the form is submitted"
);
await click(".d-modal__footer .btn-primary");
await click(".signup-fullpage .btn-primary");
assert
.dom(".user-field-what-is-your-favorite-color .tip.bad")
@@ -146,7 +136,7 @@ acceptance("Create Account - User Fields", function (needs) {
await fillIn(".user-field input[type=text]:nth-of-type(1)", "Barky");
await click(".user-field input[type=checkbox]");
await click(".d-modal__footer .btn-primary");
await click(".signup-fullpage .btn-primary");
assert
.dom(".user-field-what-is-your-favorite-color .tip.bad")
.hasText(
@@ -15,13 +15,10 @@ acceptance("Groups", function () {
.exists("shows button to request for group membership");
await click(".group-index-join");
assert.dom(".modal.login-modal").exists("shows the login modal");
await click(".login-modal .modal-close");
assert.dom(".modal.login-modal").doesNotExist("closes the login modal");
assert.dom(".login-fullpage").exists("shows the login page");
await click(".group-index-request");
assert.dom(".modal.login-modal").exists("shows the login modal");
await visit("/g");
await click("a[href='/g/discourse/members']");
assert
@@ -29,6 +26,6 @@ acceptance("Groups", function () {
.hasText("Awesome Team", "it displays the group page");
await click(".group-index-join");
assert.dom(".modal.login-modal").exists("shows the login modal");
assert.dom(".login-fullpage").exists("shows the login page");
});
});
@@ -2,7 +2,9 @@ import { currentRouteName, visit } from "@ember/test-helpers";
import { test } from "qunit";
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
acceptance("Login redirect - anonymous", function () {
acceptance("Login redirect - anonymous", function (needs) {
needs.settings({ full_page_login: false });
test("redirects login to default homepage", async function (assert) {
await visit("/login");
assert.strictEqual(
@@ -16,6 +18,7 @@ acceptance("Login redirect - anonymous", function () {
acceptance("Login redirect - categories default", function (needs) {
needs.settings({
top_menu: "categories|latest|top|hot",
full_page_login: false,
});
test("when site setting is categories", async function (assert) {
@@ -4,7 +4,11 @@ import sinon from "sinon";
import { acceptance, chromeTest } from "discourse/tests/helpers/qunit-helpers";
import { i18n } from "discourse-i18n";
acceptance("Modal - Login", function () {
acceptance("Modal - Login", function (needs) {
needs.settings({
full_page_login: false,
});
chromeTest("You can tab to the login button", async function (assert) {
await visit("/");
await click("header .login-button");
@@ -19,6 +23,7 @@ acceptance("Modal - Login", function () {
acceptance("Modal - Login - With 2FA", function (needs) {
needs.settings({
enable_local_logins_via_email: true,
full_page_login: false,
});
needs.pretender((server, helper) => {
@@ -46,7 +51,7 @@ acceptance("Modal - Login - With 2FA", function (needs) {
});
});
acceptance("Modal - Login - With Passkeys enabled", function () {
acceptance("Login - With Passkeys enabled", function () {
test("Includes passkeys button and conditional UI", async function (assert) {
await visit("/");
await click("header .login-button");
@@ -73,7 +78,7 @@ acceptance("Modal - Login - With Passkeys disabled", function (needs) {
});
});
acceptance("Modal - Login - Passkeys on mobile", function (needs) {
acceptance("Login - Passkeys on mobile", function (needs) {
needs.mobileView();
test("Includes passkeys button and conditional UI", async function (assert) {
@@ -96,7 +101,7 @@ acceptance("Modal - Login - Passkeys on mobile", function (needs) {
});
});
acceptance("Modal - Login - With no way to login", function (needs) {
acceptance("Login - With no way to login", function (needs) {
needs.settings({
enable_local_logins: false,
enable_facebook_logins: false,
@@ -49,7 +49,7 @@ acceptance("Login with email", function (needs) {
await fillIn("#login-account-name", "someuser");
await click("#email-login-link");
assert.dom("#modal-alert").hasHtml(
assert.dom(".alert-error").hasHtml(
i18n("email_login.complete_username_not_found", {
username: "someuser",
}),
@@ -59,7 +59,7 @@ acceptance("Login with email", function (needs) {
await fillIn("#login-account-name", "someuser@gmail.com");
await click("#email-login-link");
assert.dom("#modal-alert").hasHtml(
assert.dom(".alert-error").hasHtml(
i18n("email_login.complete_email_not_found", {
email: "someuser@gmail.com",
}),
@@ -9,7 +9,7 @@ acceptance("New Message - Anonymous", function () {
"/new-message?username=charlie&title=message%20title&body=message%20body"
);
assert.dom(".modal.login-modal").exists("shows the login modal");
assert.dom(".login-fullpage").exists("shows the login page");
});
});
@@ -5,9 +5,18 @@ import selectKit from "discourse/tests/helpers/select-kit-helper";
acceptance("New Topic - Anonymous", function () {
test("accessing new-topic route when logged out", async function (assert) {
await visit("/new-topic?title=topic%20title&body=topic%20body");
try {
await visit("/new-topic?title=topic%20title&body=topic%20body");
} catch (error) {
assert.strictEqual(
error.message,
"TransitionAborted",
"it aborts the transition"
);
}
assert.dom(".modal.login-modal").exists("shows the login modal");
assert.strictEqual(currentURL(), "/login");
assert.dom(".login-fullpage").exists("shows the login page");
});
});
@@ -6,15 +6,15 @@ acceptance("Signing In", function () {
test("sign in", async function (assert) {
await visit("/");
await click("header .login-button");
assert.dom(".login-modal").exists("shows the login modal");
assert.dom(".login-fullpage").exists("shows the login modal");
// Test invalid password first
await fillIn("#login-account-name", "eviltrout");
await fillIn("#login-account-password", "incorrect");
await click(".d-modal__footer .btn-primary");
assert.dom("#modal-alert").exists("displays the login error");
await click(".login-fullpage .btn-primary");
assert.dom(".alert-error").exists("displays the login error");
assert
.dom(".d-modal__footer .btn-primary")
.dom(".login-fullpage .btn-primary")
.isEnabled("enables the login button");
// Test password unmasking
@@ -28,20 +28,20 @@ acceptance("Signing In", function () {
// Use the correct password
await fillIn("#login-account-password", "correct");
await click(".d-modal__footer .btn-primary");
await click(".login-fullpage .btn-primary");
assert
.dom(".d-modal__footer .btn-primary")
.dom(".login-fullpage .btn-primary")
.isDisabled("disables the login button");
});
test("sign in - not activated", async function (assert) {
await visit("/");
await click("header .login-button");
assert.dom(".login-modal").exists("shows the login modal");
assert.dom(".login-fullpage").exists("shows the login modal");
await fillIn("#login-account-name", "eviltrout");
await fillIn("#login-account-password", "not-activated");
await click(".d-modal__footer .btn-primary");
await click(".login-fullpage .btn-primary");
assert
.dom(".d-modal__body b")
.hasText("<small>eviltrout@example.com</small>");
@@ -61,11 +61,12 @@ acceptance("Signing In", function () {
test("sign in - not activated - edit email", async function (assert) {
await visit("/");
await click("header .login-button");
assert.dom(".login-modal").exists("shows the login modal");
assert.dom(".login-fullpage").exists("shows the login page");
await fillIn("#login-account-name", "eviltrout");
await fillIn("#login-account-password", "not-activated-edit");
await click(".d-modal__footer .btn-primary");
await click(".login-fullpage .btn-primary");
await click(".d-modal__footer button.edit-email");
assert.dom(".activate-new-email").hasValue("current@example.com");
assert.dom(".d-modal__footer .btn-primary").isDisabled("must change email");
@@ -81,25 +82,26 @@ acceptance("Signing In", function () {
await visit("/");
await click("header .login-button");
assert.dom(".login-modal").exists("shows the login modal");
assert.dom(".login-fullpage").exists("shows the login page");
await fillIn("#login-account-name", "eviltrout");
await fillIn("#login-account-password", "need-second-factor");
await click(".d-modal__footer .btn-primary");
await click(".login-fullpage .btn-primary");
assert
.dom("#credentials")
.isNotVisible("hides the username and password prompt");
assert.dom("#second-factor").isVisible("displays the second factor prompt");
assert
.dom(".d-modal__footer .btn-primary")
.dom(".login-fullpage .btn-primary")
.isEnabled("enables the login button");
await fillIn("#login-second-factor", "123456");
await click(".d-modal__footer .btn-primary");
await click(".login-fullpage .btn-primary");
assert
.dom(".d-modal__footer .btn-primary")
.dom(".login-fullpage .btn-primary")
.isDisabled("disables the login button");
});
@@ -107,11 +109,11 @@ acceptance("Signing In", function () {
await visit("/");
await click("header .login-button");
assert.dom(".login-modal").exists("shows the login modal");
assert.dom(".login-fullpage").exists("shows the login page");
await fillIn("#login-account-name", "eviltrout");
await fillIn("#login-account-password", "need-security-key");
await click(".d-modal__footer .btn-primary");
await click(".login-fullpage .btn-primary");
assert
.dom("#credentials")
@@ -128,12 +130,12 @@ acceptance("Signing In", function () {
await click("header .login-button");
await fillIn("#login-account-name", "eviltrout");
await fillIn("#login-account-password", "need-second-factor");
await click(".d-modal__footer .btn-primary");
await click(".login-modal .toggle-second-factor-method");
await click(".login-fullpage .btn-primary");
await click(".login-fullpage .toggle-second-factor-method");
await fillIn("#login-second-factor", "123456");
await click(".d-modal__footer .btn-primary");
await click(".login-fullpage .btn-primary");
assert.dom(".d-modal__footer .btn-primary").isDisabled();
assert.dom(".login-fullpage .btn-primary").isDisabled();
});
test("second factor backup - invalid token", async function (assert) {
@@ -141,13 +143,13 @@ acceptance("Signing In", function () {
await click("header .login-button");
await fillIn("#login-account-name", "eviltrout");
await fillIn("#login-account-password", "need-second-factor");
await click(".d-modal__footer .btn-primary");
await click(".login-modal .toggle-second-factor-method");
await click(".login-fullpage .btn-primary");
await click(".login-fullpage .toggle-second-factor-method");
await fillIn("#login-second-factor", "something");
await click(".d-modal__footer .btn-primary");
await click(".login-fullpage .btn-primary");
assert
.dom("#modal-alert")
.dom(".alert-error")
.exists("shows an error when the code is invalid");
});
});
@@ -42,6 +42,7 @@ acceptance("Static pages", function () {
});
test("Login redirect", async function (assert) {
this.siteSettings.full_page_login = false;
await visit("/login");
assert.strictEqual(
@@ -62,6 +63,7 @@ acceptance("Static pages", function () {
});
test("Signup redirect", async function (assert) {
this.siteSettings.full_page_login = false;
await visit("/signup");
assert.strictEqual(
@@ -72,6 +74,7 @@ acceptance("Static pages", function () {
});
test("Signup redirect with login_required", async function (assert) {
this.siteSettings.full_page_login = false;
this.siteSettings.login_required = true;
await visit("/signup");
+1
View File
@@ -66,6 +66,7 @@ class ProblemCheck
ProblemCheck::FacebookConfig,
ProblemCheck::FailingEmails,
ProblemCheck::ForceHttps,
ProblemCheck::FullPageLoginCheck,
ProblemCheck::GithubConfig,
ProblemCheck::GoogleAnalyticsVersion,
ProblemCheck::GoogleOauth2Config,
@@ -0,0 +1,19 @@
# frozen_string_literal: true
class ProblemCheck::FullPageLoginCheck < ProblemCheck
self.priority = "low"
def call
if full_page_login_disabled?
return problem(override_key: "dashboard.problem.full_page_login_check")
end
no_problem
end
private
def full_page_login_disabled?
SiteSetting.full_page_login == false
end
end
+1
View File
@@ -1735,6 +1735,7 @@ en:
category_style_deprecated: "Your Discourse is currently using a deprecated category style which will be removed before the final beta release of Discourse 3.2. Please refer to <a href='https://meta.discourse.org/t/282441'>Moving to a Single Category Style Site Setting</a> for instructions on how to keep your selected category style."
maxmind_db_configuration: 'The server has been configured to use MaxMind databases for reverse IP lookups but a valid MaxMind account ID has not been configured which may result in MaxMind databases failing to download in the future. <a href="https://meta.discourse.org/t/configure-maxmind-for-reverse-ip-lookups/173941" target="_blank">See this guide to learn more</a>.'
admin_sidebar_deprecation: "The old admin layout is deprecated in favour of the new <a href='https://meta.discourse.org/t/-/289281'>sidebar layout</a> and will be removed in the next release. You can <a href='%{base_path}/admin/config/navigation?filter=admin%20sidebar'>configure</a> the new sidebar layout now to opt in before that."
full_page_login_check: "Your site has disabled the full page login setting. This setting is deprecated and will be removed on <strong>29 April 2025</strong>. Your site will be updated to use full page signup and login screens on that date. <a href='https://meta.discourse.org/t/introducing-our-new-fullscreen-signup-and-login-pages/340401'>Learn more</a>."
back_from_logster_text: "Back to site"
site_settings:
+1 -1
View File
@@ -689,7 +689,7 @@ login:
min: 1
max: 175200
full_page_login:
default: false
default: true
client: true
show_signup_form_email_instructions:
client: true
@@ -0,0 +1,19 @@
# frozen_string_literal: true
RSpec.describe ProblemCheck::FullPageLoginCheck do
let(:check) { described_class.new }
describe "#call" do
context "when full_page_login is enabled" do
before { SiteSetting.full_page_login = true }
it { expect(check).to be_chill_about_it }
end
context "when full_page_login is enabled" do
before { SiteSetting.full_page_login = false }
it { expect(check).to have_a_problem.with_priority("low") }
end
end
end
-23
View File
@@ -1,23 +0,0 @@
# frozen_string_literal: true
describe "Create account", type: :system do
it "creates a user account" do
visit "/"
click_button "Sign Up"
expect(page).to have_css(".d-modal.create-account")
find("#new-account-email").fill_in with: "test@example.com"
find("#new-account-username").fill_in with: "user1"
expect(page.find("#username-validation")).to have_content("Your username is available")
find("#new-account-password").fill_in with: "secret-password"
find(".d-modal.create-account").click_button "Sign Up"
expect(page).to have_no_css(".d-modal.create-account")
user = User.last
expect(user.username).to eq("user1")
expect(user.emails).to eq(["test@example.com"])
end
end
+2 -1
View File
@@ -103,7 +103,8 @@ describe "Changing email", type: :system do
authenticator&.remove!
end
it "does not require login to verify" do
it "does not require login to confirm email change" do
SiteSetting.full_page_login = false
second_factor = Fabricate(:user_second_factor_totp, user: user)
sign_in user
-1
View File
@@ -3,7 +3,6 @@
require "rotp"
shared_examples "forgot password scenarios" do
let(:login_modal) { PageObjects::Modals::Login.new }
let(:user_preferences_security_page) { PageObjects::Pages::UserPreferencesSecurity.new }
fab!(:user) { Fabricate(:user, username: "john", password: "supersecurepassword") }
fab!(:password_reset_token) do
+8 -4
View File
@@ -12,18 +12,22 @@ RSpec.describe "Glimmer Header", type: :system do
expect(page).to have_css("#site-logo")
end
it "displays sign up / login buttons" do
it "displays sign up button" do
visit "/"
expect(page).to have_css("button.sign-up-button")
expect(page).to have_css("button.login-button")
find("button.sign-up-button").click
expect(page).to have_css(".d-modal.create-account")
expect(page).to have_css(".signup-fullpage")
end
header.click_outside
it "displays login button" do
visit "/"
expect(page).to have_css("button.sign-up-button")
expect(page).to have_css("button.login-button")
find("button.login-button").click
expect(page).to have_css(".d-modal.login-modal")
expect(page).to have_css(".login-fullpage")
end
it "shows login button when login required" do
+2
View File
@@ -360,10 +360,12 @@ end
describe "Login", type: :system do
context "when desktop" do
before { SiteSetting.full_page_login = false }
include_examples "login scenarios", PageObjects::Modals::Login.new
end
context "when mobile", mobile: true do
before { SiteSetting.full_page_login = false }
include_examples "login scenarios", PageObjects::Modals::Login.new
end
+2 -2
View File
@@ -10,7 +10,7 @@ describe "Post menu", type: :system do
let(:composer) { PageObjects::Components::Composer.new }
let(:topic_page) { PageObjects::Pages::Topic.new }
let(:flag_modal) { PageObjects::Modals::Flag.new }
let(:login_modal) { PageObjects::Modals::Login.new }
let(:login_page) { PageObjects::Pages::Login.new }
let(:modal) { PageObjects::Modals::Base.new }
%w[enabled disabled].each do |value|
@@ -462,7 +462,7 @@ describe "Post menu", type: :system do
# clicking on the like button should display the login modal
topic_page.click_post_action_button(post2, :like)
expect(login_modal).to be_open
expect(login_page).to be_open
end
it "renders the like count as expected" do
+2
View File
@@ -350,12 +350,14 @@ end
describe "Signup", type: :system do
context "when desktop" do
before { SiteSetting.full_page_login = false }
include_examples "signup scenarios",
PageObjects::Modals::Signup.new,
PageObjects::Modals::Login.new
end
context "when mobile", mobile: true do
before { SiteSetting.full_page_login = false }
include_examples "signup scenarios",
PageObjects::Modals::Signup.new,
PageObjects::Modals::Login.new
@@ -455,12 +455,14 @@ describe "Social authentication", type: :system do
before { SiteSetting.full_name_requirement = "optional_at_signup" }
context "when desktop" do
before { SiteSetting.full_page_login = false }
include_examples "social authentication scenarios",
PageObjects::Modals::Signup.new,
PageObjects::Modals::Login.new
end
context "when mobile", mobile: true do
before { SiteSetting.full_page_login = false }
include_examples "social authentication scenarios",
PageObjects::Modals::Signup.new,
PageObjects::Modals::Login.new
@@ -41,7 +41,7 @@ describe "User preferences | Security", type: :system do
find("input#login-account-name").fill_in(with: user.username)
find("input#login-account-password").fill_in(with: password)
find(".d-modal__footer .btn-primary").click
find("#login-button.btn-primary").click
find("#security-key .btn-primary").click
expect(page).to have_css(".header-dropdown-toggle.current-user")