diff --git a/CHANGES.md b/CHANGES.md
index 4bb386d04c0fd6c10becf70b1fa2c38e75fe2dda..b5a90beee8e404923dba502fe96b1d1e749ae743 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -6,6 +6,7 @@ Changes
 
 ### Unreleased
 
+* 2021-04-11 - Fix Behat test for random login background image
 * 2021-03-14 - Fix Behat test for unrestricted self enrolment hint
 
 ### v3.10-r4
diff --git a/tests/behat/theme_boost_campus_design_settings.feature b/tests/behat/theme_boost_campus_design_settings.feature
index 8f503d5dd72907a3cb634b4a46a8d426112c89fe..51aaf8817042b3966ad47039d3dd9045feb61e93 100644
--- a/tests/behat/theme_boost_campus_design_settings.feature
+++ b/tests/behat/theme_boost_campus_design_settings.feature
@@ -26,7 +26,10 @@ Feature: Configuring the theme_boost_campus plugin for the "Design Settings" tab
     And I press "Save changes"
     And I log out
     And I click on "Log in" "link"
-    Then the "class" attribute of "body" "css_element" should contain "loginbackgroundimage1"
+    And I am on homepage
+    And I click on "Log in" "link" in the ".logininfo" "css_element"
+    Then the "class" attribute of "body" "css_element" should contain "path-login"
+    And the "class" attribute of "body" "css_element" should contain "loginbackgroundimage1"
 
   # Dependent on setting "Use Login page background images"
   @javascript @_file_upload
@@ -39,7 +42,10 @@ Feature: Configuring the theme_boost_campus plugin for the "Design Settings" tab
     And I press "Save changes"
     And I log out
     And I click on "Log in" "link"
-    Then I should see "Copyright by SplitShire on pexels.com" in the "#loginbackgroundimagetext" "css_element"
+    And I am on homepage
+    And I click on "Log in" "link" in the ".logininfo" "css_element"
+    Then the "class" attribute of "body" "css_element" should contain "path-login"
+    And I should see "Copyright by SplitShire on pexels.com" in the "#loginbackgroundimagetext" "css_element"
 
   # This is not testable with Behat
   # Scenario: Enable "Login form"