From e31bbc56ce1bfe2f52c762f70cf96707338fbce4 Mon Sep 17 00:00:00 2001
From: Kathrin Osswald <kathrin.osswald@uni-ulm.de>
Date: Wed, 26 Feb 2020 08:32:26 +0100
Subject: [PATCH] Added Behat tests.

---
 CHANGES.md                             |  4 ++++
 tests/behat/auth_ldap_syncplus.feature | 15 +++++++++++++++
 2 files changed, 19 insertions(+)
 create mode 100644 tests/behat/auth_ldap_syncplus.feature

diff --git a/CHANGES.md b/CHANGES.md
index 14cbc77..5307c1d 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -4,6 +4,10 @@ moodle-auth_ldap_syncplus
 Changes
 -------
 
+### Unreleased
+
+* 2020-02-26 - Added Behat tests.
+
 ### v3.8-r1
 
 * 2020-02-19 - Adopt code changes Moodle 3.8 core auth_ldap.
diff --git a/tests/behat/auth_ldap_syncplus.feature b/tests/behat/auth_ldap_syncplus.feature
new file mode 100644
index 0000000..c366688
--- /dev/null
+++ b/tests/behat/auth_ldap_syncplus.feature
@@ -0,0 +1,15 @@
+@auth @auth_ldap_syncplus
+Feature: Checking that all settings are shown
+  In order to be able to configure the auth_ldap_syncplus plugin
+  As admin
+  I need to be able to see the equivalent settings
+
+  # This is the only check that is possible to do with Behat tests. The functionality behind cannot be tested with Behat tests.
+  Scenario: Check if all LDAP server (Sync Plus) settings are there
+    Given I log in as "admin"
+    And I navigate to "Plugins > Authentication >  Manage authentication" in site administration
+    And I click on "Settings" "link" in the "LDAP server (Sync Plus)" "table_row"
+    Then I should see "LDAP server (Sync Plus)" in the "#region-main .settingsform" "css_element"
+    And the "Removed ext user" select box should contain "Suspend internal and fully delete internal after grace period"
+    And I should see "Fully deleting grace period" in the "#admin-removeuser_graceperiod" "css_element"
+    And I should see "Add new users" in the "#admin-sync_script_createuser_enabled" "css_element"
-- 
GitLab