OSDN Git Service

Внесены исправления в тесты для корректной работы с контролем доступа по ролям
[invent/invent.git] / tests / functional / LocationsCest.php
1 <?php 
2
3 class LocationsCest
4 {
5     public function _before(\FunctionalTester $I)
6     {
7         $I->amLoggedInAs(\app\models\User::findByUsername('admin'));
8         $I->amOnRoute('locations/index');
9     }
10
11     // tests
12     // Проверка открытой страницы
13     public function openLocationsPage(\FunctionalTester $I)
14     {
15         // Заголовок
16         $I->see(Yii::t('locations', 'Locations'), 'h1');
17         // Таблица
18         $I->see(Yii::t('locations', 'Location name'), '#LocationsTable th a');
19         $I->see(Yii::t('regions', 'Region name'), '#LocationsTable th a');
20         // Кнопки
21         $I->see(Yii::t('locations', 'Create location'), 'a.btn');
22     }
23
24     // Переход на "Добавить место"
25     public function pushCreate(\FunctionalTester $I)
26     {
27         $I->click(Yii::t('locations', 'Create location'), 'a.btn');
28         $I->see(Yii::t('locations', 'Create location'), 'h1');
29     }
30
31     // клик по месту
32     public function clickUpdate(\FunctionalTester $I)
33     {
34         $I->click('', '#LocationsTable td a');
35         $I->see(Yii::t('locations', 'Update Locations: {name}', [ 'name' => '', ]), 'h1');
36     }
37 }