1@tool @tool_usertours 2Feature: Add a new user tour 3 In order to help users learn of new features 4 As an administrator 5 I need to create a user tour 6 7 @javascript 8 Scenario: Add a new tour 9 Given the following "users" exist: 10 | username | firstname | lastname | email | 11 | student1 | Student | 1 | student1@example.com | 12 And I log in as "admin" 13 And I add a new user tour with: 14 | Name | First tour | 15 | Description | My first tour | 16 | Apply to URL match | /my/% | 17 | Tour is enabled | 1 | 18 And I add steps to the "First tour" tour: 19 | targettype | Title | Content | 20 | Display in middle of page | Welcome | Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful | 21 And I add steps to the "First tour" tour: 22 | targettype | targetvalue_block | Title | Content | 23 | Block | Course overview | Course overview | This area shows you what's happening in some of your courses | 24 | Block | Calendar | Calendar | This is the Calendar. All of your assignments and due dates can be found here | 25 And I add steps to the "First tour" tour: 26 | targettype | targetvalue_selector | Title | Content | 27 | Selector | .usermenu | User menu | This is your personal user menu. You'll find your personal preferences and your user profile here. | 28 When I am on homepage 29 Then I should see "Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful" 30 And I click on "Next" "button" in the "[data-role='flexitour-step']" "css_element" 31 And I should see "This area shows you what's happening in some of your courses" 32 And I should not see "This is the Calendar. All of your assignments and due dates can be found here" 33 And I click on "Next" "button" in the "[data-role='flexitour-step']" "css_element" 34 And I should see "This is the Calendar. All of your assignments and due dates can be found here" 35 And I should not see "This area shows you what's happening in some of your courses" 36 And I click on "Prev" "button" in the "[data-role='flexitour-step']" "css_element" 37 And I should not see "This is the Calendar. All of your assignments and due dates can be found here" 38 And I should see "This area shows you what's happening in some of your courses" 39 And I click on "End tour" "button" in the "[data-role='flexitour-step']" "css_element" 40 And I should not see "This area shows you what's happening in some of your courses" 41 And I am on homepage 42 And I should not see "Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful" 43 And I should not see "This area shows you what's happening in some of your courses" 44 And I follow "Reset user tour on this page" 45 And I should see "Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful" 46 47 @javascript 48 Scenario: A hidden tour should not be visible 49 Given the following "users" exist: 50 | username | firstname | lastname | email | 51 | student1 | Student | 1 | student1@example.com | 52 And I log in as "admin" 53 And I add a new user tour with: 54 | Name | First tour | 55 | Description | My first tour | 56 | Apply to URL match | /my/% | 57 | Tour is enabled | 0 | 58 And I add steps to the "First tour" tour: 59 | targettype | Title | Content | 60 | Display in middle of page | Welcome | Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful | 61 When I am on homepage 62 Then I should not see "Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful" 63 64 @javascript 65 Scenario: Tour visibility can be toggled 66 Given the following "users" exist: 67 | username | firstname | lastname | email | 68 | student1 | Student | 1 | student1@example.com | 69 And I log in as "admin" 70 And I add a new user tour with: 71 | Name | First tour | 72 | Description | My first tour | 73 | Apply to URL match | /my/% | 74 | Tour is enabled | 0 | 75 And I add steps to the "First tour" tour: 76 | targettype | Title | Content | 77 | Display in middle of page | Welcome | Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful | 78 And I open the User tour settings page 79 When I click on "Enable" "link" in the "My first tour" "table_row" 80 And I am on homepage 81 Then I should see "Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful" 82