Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 11
Línea 47... Línea 47...
47
        return [
47
        return [
48
            new behat_component_named_selector('mini calendar block', [".//*[@data-block='calendar_month']"]),
48
            new behat_component_named_selector('mini calendar block', [".//*[@data-block='calendar_month']"]),
49
            new behat_component_named_selector('full calendar page', [".//*[@id='page-calendar-view']"]),
49
            new behat_component_named_selector('full calendar page', [".//*[@id='page-calendar-view']"]),
50
            new behat_component_named_selector('calendar day', [".//*[@data-region='day'][@data-day=%locator%]"]),
50
            new behat_component_named_selector('calendar day', [".//*[@data-region='day'][@data-day=%locator%]"]),
51
            new behat_component_named_selector(
51
            new behat_component_named_selector(
-
 
52
                'calendar day detail',
-
 
53
                [".//*[@data-region='day'][@data-day=%locator%]//a[@data-action='view-day-link']"]
-
 
54
            ),
-
 
55
            new behat_component_named_selector(
52
                'responsive calendar day',
56
                'responsive calendar day',
53
                [".//*[@data-region='day'][@data-day=%locator%]/div[contains(@class, 'hidden-desktop')]"]
57
                [".//*[@data-region='day'][@data-day=%locator%]/div[contains(@class, 'hidden-desktop')]"]
54
            ),
58
            ),
-
 
59
            new behat_component_named_selector(
-
 
60
                'responsive calendar day detail',
-
 
61
                [".//*[@data-region='day'][@data-day=%locator%]" .
-
 
62
                    "/div[contains(@class, 'hidden-desktop')]//a[@data-action='view-day-link']"]
-
 
63
            ),
55
        ];
64
        ];
56
    }
65
    }
Línea 57... Línea 66...
57
 
66
 
58
    /**
67
    /**
Línea 131... Línea 140...
131
            ],
140
            ],
132
        );
141
        );
133
    }
142
    }
Línea 134... Línea 143...
134
 
143
 
-
 
144
    /**
-
 
145
     * Click on a specific day in the mini-calendar.
-
 
146
     *
-
 
147
     * @Given /^I click on day "(?P<dayofmonth>\d+)" of this month in the mini-calendar block(?P<responsive> responsive view|)$/
-
 
148
     *
-
 
149
     * @param int $day The day of the current month.
-
 
150
     * @param string $responsive If not null, find the responsive version of the link.
-
 
151
     * @param string $detail If not null, find the detail version of the link.
-
 
152
     */
-
 
153
    public function i_click_on_day_of_this_month_in_mini_calendar_block(
-
 
154
        int $day,
-
 
155
        string $responsive = '',
-
 
156
        string $detail = '',
-
 
157
    ): void {
-
 
158
        $selectortype = 'core_calendar >';
-
 
159
        if (!empty($responsive)) {
-
 
160
            $selectortype .= ' responsive';
-
 
161
        }
-
 
162
        $selectortype .= ' calendar day';
-
 
163
        if (!empty($detail)) {
-
 
164
            $selectortype .= ' detail';
-
 
165
        }
-
 
166
        $this->execute(
-
 
167
            contextapi: "behat_general::i_click_on_in_the",
-
 
168
            params: [
-
 
169
                $day,
-
 
170
                $selectortype,
-
 
171
                '',
-
 
172
                'core_calendar > mini calendar block',
-
 
173
            ],
-
 
174
        );
-
 
175
    }
-
 
176
 
135
    /**
177
    /**
136
     * Hover over today in the mini-calendar.
178
     * Hover over today in the mini-calendar.
137
     *
179
     *
138
     * @Given /^I hover over today in the mini-calendar block( responsive view|)$/
180
     * @Given /^I hover over today in the mini-calendar block( responsive view|)$/
139
     *
181
     *
Línea 143... Línea 185...
143
        $todaysday = date('j');
185
        $todaysday = date('j');
144
        $this->i_hover_over_day_of_this_month_in_mini_calendar_block($todaysday, $responsive);
186
        $this->i_hover_over_day_of_this_month_in_mini_calendar_block($todaysday, $responsive);
145
    }
187
    }
Línea 146... Línea 188...
146
 
188
 
-
 
189
    /**
-
 
190
     * Click on today in the mini-calendar.
-
 
191
     *
-
 
192
     * @Given /^I click on today in the mini-calendar block( responsive view|)( to view the detail|)$/
-
 
193
     *
-
 
194
     * @param string $responsive If not empty, use the responsive calendar link.
-
 
195
     * @param string $detail If not empty, use the detail view calendar link.
-
 
196
     */
-
 
197
    public function i_click_on_today_in_mini_calendar_block(string $responsive = '', string $detail = ''): void {
-
 
198
        $this->i_click_on_day_of_this_month_in_mini_calendar_block(
-
 
199
            day: date('j'),
-
 
200
            responsive: $responsive,
-
 
201
            detail: $detail,
-
 
202
        );
-
 
203
    }
-
 
204
 
147
    /**
205
    /**
148
     * Navigate to a specific month in the calendar.
206
     * Navigate to a specific month in the calendar.
149
     *
207
     *
150
     * @Given /^I view the calendar for "(?P<month>\d+)" "(?P<year>\d+)"$/
208
     * @Given /^I view the calendar for "(?P<month>\d+)" "(?P<year>\d+)"$/
151
     * @param int $month the month selected as a number
209
     * @param int $month the month selected as a number