From f0724d200a6a1b60e137563aea8b72d60b78a5e1 Mon Sep 17 00:00:00 2001 From: Rajesh Taneja Date: Wed, 14 Jan 2015 14:21:59 +0800 Subject: [PATCH] MDL-48831 behat: Added behat test for label activity Thanks to Neill Magill, for providing test feature. --- .../tests/behat/label_visibility.feature | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/mod/label/tests/behat/label_visibility.feature b/mod/label/tests/behat/label_visibility.feature index e69de29bb2d..99920a1bcd1 100644 --- a/mod/label/tests/behat/label_visibility.feature +++ b/mod/label/tests/behat/label_visibility.feature @@ -0,0 +1,37 @@ +@mod @mod_label +Feature: Check label visibility works + In order to check label visibility works + As a teacher + I should create label activity + + @javascript + Scenario: Hidden label activity should be show as hidden. + Given the following "courses" exist: + | fullname | shortname | category | + | Test | C1 | 0 | + And the following "course enrolments" exist: + | user | course | role | + | admin | C1 | editingteacher | + Given I log in as "admin" + And I follow "Test" + And I turn editing mode on + When I add a "label" to section "1" and I fill the form with: + | Label text | Swanky label | + | Visible | Hide | + Then "Swanky label" activity should be hidden + + @javascript + Scenario: Visible label activity should be shown as visible. + Given the following "courses" exist: + | fullname | shortname | category | + | Test | C1 | 0 | + And the following "course enrolments" exist: + | user | course | role | + | admin | C1 | editingteacher | + Given I log in as "admin" + And I follow "Test" + And I turn editing mode on + When I add a "label" to section "1" and I fill the form with: + | Label text | Swanky label | + | Visible | Show | + Then "Swanky label" activity should be visible