Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/Browser/Common/AdminLinkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ private function adminLink()
$this->browse(function (Browser $browser) {
$browser->visit('/')
->assertTitleContains('Connect-CMS')
->waitFor('#dropdown_manage')
->screenshot('common/admin_link/index/images/admin_link1');

$browser->click('#dropdown_manage')
Expand Down
12 changes: 6 additions & 6 deletions tests/Browser/Common/LoginLockTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,27 +43,27 @@ private function loginLockTest()
->type('#userid', 'admin')
->type('#password', 'error001')
->click('@login-button')
->pause(500)
->waitForText('ログインできません')
->type('#userid', 'admin')
->type('#password', 'error002')
->click('@login-button')
->pause(500)
->waitForText('ログインできません')
->type('#userid', 'admin')
->type('#password', 'error003')
->click('@login-button')
->pause(500)
->waitForText('ログインできません')
->type('#userid', 'admin')
->type('#password', 'error004')
->click('@login-button')
->pause(500)
->waitForText('ログインできません')
->type('#userid', 'admin')
->type('#password', 'error005')
->click('@login-button')
->pause(500)
->waitForText('ログインできません')
->type('#userid', 'admin')
->type('#password', 'error006')
->click('@login-button')
->pause(500)
->waitForText('ログインできません')
->screenshot('common/index/lock/images/loginLock');
});

Expand Down
2 changes: 1 addition & 1 deletion tests/Browser/Common/LoginLogoutTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ private function logoutTest()
->assertTitleContains('Connect-CMS')
->screenshot('common/index/logout/images/logout1');

$browser->click('#dropdown_auth')
$browser->waitFor('#dropdown_auth')->click('#dropdown_auth')
->assertTitleContains('Connect-CMS')
->screenshot('common/index/logout/images/logout2');

Expand Down
4 changes: 2 additions & 2 deletions tests/Browser/Common/PasswordPageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ private function setPassword()
->screenshot('common/password_page/index/images/setPassword')
->scrollIntoView('footer')
->press('ページ更新')
->pause(500); // github actionsの安定性のためにpress後に少し待つ
->pause(500);
});

// マニュアル用データ出力
Expand Down Expand Up @@ -86,7 +86,7 @@ private function viewPage()
->type('password', 'pass123')
->screenshot('common/password_page/viewPage/images/inputPassword')
->press('ページ閲覧')
->pause(500); // github actionsの安定性のためにpress後に少し待つ
->waitForLocation('/password');
});

// *** データクリア
Expand Down
67 changes: 36 additions & 31 deletions tests/Browser/Common/WysiwygTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ private function index()

// 固定記事のページを開く
$browser->visit('/plugin/contents/edit/' . $frame->page_id . '/' . $frame->id . '/' . $this->content->id . '#frame-' . $frame->id)
->pause(500)
->waitFor('.tox-tinymce')
->assertPathBeginsWith('/')
->screenshot('common/wysiwyg/index/images/index');
});
Expand Down Expand Up @@ -167,7 +167,7 @@ private function decoration()

// 固定記事のページを開く
$browser->visit('/plugin/contents/edit/' . $frame->page_id . '/' . $frame->id . '/' . $this->content->id . '#frame-' . $frame->id)
->pause(500)
->waitFor('.tox-tinymce')
->assertPathBeginsWith('/')
->screenshot('common/wysiwyg/decoration/images/decoration');
});
Expand Down Expand Up @@ -200,8 +200,9 @@ private function paragraph()
$this->browse(function (Browser $browser) {
// 段落
$browser->visit('/plugin/contents/edit/' . $this->frame->page_id . '/' . $this->frame->id . '/' . $this->content->id . '#frame-' . $this->frame->id)
->waitFor('.tox-tinymce')
->click('#ccMainArea .tox-tinymce .tox-toolbar__group:nth-child(3) button')
->pause(500)
->waitFor('.tox-collection')
->screenshot('common/wysiwyg/paragraph/images/paragraph');
});

Expand Down Expand Up @@ -233,6 +234,7 @@ private function color()
$this->browse(function (Browser $browser) {
// 文字色のカラーパネル
$browser->visit('/plugin/contents/edit/' . $this->frame->page_id . '/' . $this->frame->id . '/' . $this->content->id . '#frame-' . $this->frame->id)
->waitFor('.tox-tinymce')
->click('#ccMainArea .tox-tinymce .tox-toolbar__group:nth-child(4) div:nth-child(1) span:nth-child(2)')
->pause(500)
->screenshot('common/wysiwyg/color/images/colorPickerFont');
Expand Down Expand Up @@ -289,11 +291,12 @@ private function table()
$content->save();

// 記事をデータベースから変更したので、一度開きなおす。
$browser->visit('/plugin/contents/edit/' . $this->frame->page_id . '/' . $this->frame->id . '/' . $content->id . '#frame-' . $this->frame->id);
$browser->visit('/plugin/contents/edit/' . $this->frame->page_id . '/' . $this->frame->id . '/' . $content->id . '#frame-' . $this->frame->id)
->waitFor('.tox-tinymce');

// 表のドロップダウン
$browser->click('#ccMainArea .tox-tinymce .tox-toolbar__group:nth-child(6) button:nth-child(1) div')
->pause(500)
->waitFor('.tox-collection')
->screenshot('common/wysiwyg/table/images/table');

// 表のドロップダウン > 表
Expand All @@ -318,8 +321,7 @@ private function table()
->screenshot('common/wysiwyg/table/images/table_cell_detail_detail');

// 一度開きなおす。
$browser->visit('/')
->pause(500);
$browser->visit('/');

$browser->visit('/plugin/contents/edit/' . $this->frame->page_id . '/' . $this->frame->id . '/' . $content->id . '#frame-' . $this->frame->id)
->pause(500)
Expand All @@ -336,43 +338,42 @@ private function table()

// 表のドロップダウン > 行 > 行の詳細設定
$browser->click('.tox-collection--list:nth-child(2) .tox-collection__item:nth-child(4)')
->pause(500)
->waitFor('.tox-dialog')
->screenshot('common/wysiwyg/table/images/table_row_detail');

// 表のドロップダウン > 行 > 行の詳細設定 > 詳細設定
$browser->click('.tox-tab:nth-child(2)')
->pause(500)
->waitFor('.tox-dialog')
->screenshot('common/wysiwyg/table/images/table_row_detail_detail');

// 一度開きなおす。
$browser->visit('/')
->pause(500);
$browser->visit('/');

$browser->visit('/plugin/contents/edit/' . $this->frame->page_id . '/' . $this->frame->id . '/' . $content->id . '#frame-' . $this->frame->id)
->pause(500)
->waitFor('.tox-tinymce')
->screenshot('common/wysiwyg/table/images/edit_reopen2');

// 表のドロップダウン
$browser->click('#ccMainArea .tox-tinymce .tox-toolbar__group:nth-child(6) button:nth-child(1) div')
->pause(500);
->waitFor('.tox-collection');

// 表のドロップダウン > 列
$browser->mouseover('.tox-collection__group:nth-child(2) .tox-collection__item:nth-child(3)')
->pause(500)
->waitFor('.tox-collection')
->screenshot('common/wysiwyg/table/images/table_col');

// 表のドロップダウン > 表の詳細設定
$browser->mouseover('.tox-collection__group:nth-child(3) .tox-collection__item:nth-child(1)')
->pause(500)
->waitFor('.tox-collection')
->screenshot('common/wysiwyg/table/images/table_detail_mouse');

$browser->click('.tox-collection__group:nth-child(3) .tox-collection__item:nth-child(1)')
->pause(500)
->waitFor('.tox-dialog')
->screenshot('common/wysiwyg/table/images/table_detail_click');

// 表のドロップダウン > 表の詳細設定 > 詳細設定
$browser->click('.tox-tab:nth-child(2)')
->pause(500)
->waitFor('.tox-dialog')
->screenshot('common/wysiwyg/table/images/table_detail_detail');
});

Expand Down Expand Up @@ -455,8 +456,9 @@ private function hr()

// 段落
$browser->visit('/plugin/contents/edit/' . $this->frame->page_id . '/' . $this->frame->id . '/' . $this->content->id . '#frame-' . $this->frame->id)
->waitFor('.tox-tinymce')
->click('#ccMainArea .tox-tinymce .tox-toolbar__group:nth-child(6) button:nth-child(2)')
->pause(500)
->waitFor('.tox-tinymce')
->screenshot('common/wysiwyg/hr/images/hr');
});

Expand Down Expand Up @@ -488,14 +490,16 @@ private function list()
$this->browse(function (Browser $browser) {
// リスト(箇条書き UL)
$browser->visit('/plugin/contents/edit/' . $this->frame->page_id . '/' . $this->frame->id . '/' . $this->content->id . '#frame-' . $this->frame->id)
->waitFor('.tox-tinymce')
->click('#ccMainArea .tox-tinymce .tox-toolbar__group:nth-child(7) div:nth-child(1) span:nth-child(2)')
->pause(500)
->waitFor('.tox-tinymce')
->screenshot('common/wysiwyg/list/images/list_ul');

// リスト(番号付き箇条書き OL)
$browser->visit('/plugin/contents/edit/' . $this->frame->page_id . '/' . $this->frame->id . '/' . $this->content->id . '#frame-' . $this->frame->id)
->waitFor('.tox-tinymce')
->click('#ccMainArea .tox-tinymce .tox-toolbar__group:nth-child(7) div:nth-child(2) span:nth-child(2)')
->pause(500)
->waitFor('.tox-tinymce')
->screenshot('common/wysiwyg/list/images/list_ol');
});

Expand Down Expand Up @@ -610,8 +614,7 @@ private function image()
$this->browse(function (Browser $browser) {

// 一度開きなおす。
$browser->visit('/')
->pause(500);
$browser->visit('/');

$browser->visit('/plugin/contents/edit/' . $this->frame->page_id . '/' . $this->frame->id . '/' . $this->content->id . '#frame-' . $this->frame->id)
->click('#ccMainArea .tox-tinymce .tox-toolbar__group:nth-child(12) button:nth-child(1)')
Expand Down Expand Up @@ -646,8 +649,7 @@ private function file()
// 画面
$this->browse(function (Browser $browser) {
// 一度開きなおす。
$browser->visit('/')
->pause(500);
$browser->visit('/');

$browser->visit('/plugin/contents/edit/' . $this->frame->page_id . '/' . $this->frame->id . '/' . $this->content->id . '#frame-' . $this->frame->id)
->click('#ccMainArea .tox-tinymce .tox-toolbar__group:nth-child(12) button:nth-child(2)')
Expand Down Expand Up @@ -682,8 +684,7 @@ private function media()
// 画面
$this->browse(function (Browser $browser) {
// 一度開きなおす。
$browser->visit('/')
->pause(500);
$browser->visit('/');

$browser->visit('/plugin/contents/edit/' . $this->frame->page_id . '/' . $this->frame->id . '/' . $this->content->id . '#frame-' . $this->frame->id)
->click('#ccMainArea .tox-tinymce .tox-toolbar__group:nth-child(12) button:nth-child(3)')
Expand Down Expand Up @@ -740,8 +741,9 @@ private function preview()
->pause(500);

$browser->visit('/plugin/contents/edit/' . $this->frame->page_id . '/' . $this->frame->id . '/' . $this->content->id . '#frame-' . $this->frame->id)
->waitFor('.tox-tinymce')
->click('#ccMainArea .tox-tinymce .tox-toolbar__group:nth-child(13) button')
->pause(500)
->waitFor('.tox-collection, .tox-dialog')
->screenshot('common/wysiwyg/preview/images/preview');
});

Expand Down Expand Up @@ -771,8 +773,9 @@ private function source()
->pause(500);

$browser->visit('/plugin/contents/edit/' . $this->frame->page_id . '/' . $this->frame->id . '/' . $this->content->id . '#frame-' . $this->frame->id)
->waitFor('.tox-tinymce')
->click('#ccMainArea .tox-tinymce .tox-toolbar__group:nth-child(14) button')
->pause(500)
->waitFor('.tox-dialog')
->screenshot('common/wysiwyg/source/images/source');
});

Expand Down Expand Up @@ -807,9 +810,10 @@ private function translate()

// 編集画面を開き、WYSIWYGエディタのセレクタをターゲットにCTRL+Aキーを押して、全選択させる。その後に翻訳プラグインを起動することで、翻訳するテキストが選択されている状態。
$browser->visit('/plugin/contents/edit/' . $this->frame->page_id . '/' . $this->frame->id . '/' . $this->content->id . '#frame-' . $this->frame->id)
->waitFor('#mce_0_ifr')
->keys('#mce_0_ifr', ['{control}', 'a'])
->click('#ccMainArea .tox-tinymce .tox-toolbar__group:nth-child(15) button:nth-child(1)')
->pause(500)
->waitFor('.tox-dialog, .tox-collection')
->screenshot('common/wysiwyg/translate/images/translate');

// 2022-03-20 翻訳API の許可がIP アドレス指定になっているので、マニュアル用にデータ編集方式で進める。
Expand Down Expand Up @@ -865,8 +869,9 @@ private function pdf()
->pause(500);

$browser->visit('/plugin/contents/edit/' . $this->frame->page_id . '/' . $this->frame->id . '/' . $this->content->id . '#frame-' . $this->frame->id)
->waitFor('.tox-tinymce')
->click('#ccMainArea .tox-tinymce .tox-toolbar__group:nth-child(15) button:nth-child(2)')
->pause(500)
->waitFor('.tox-dialog, .tox-collection')
->screenshot('common/wysiwyg/pdf/images/pdf1');

// PDFアップロード後に合わせた記事に変更
Expand All @@ -880,7 +885,7 @@ private function pdf()

// 編集画面開きなおし
$browser->visit('/plugin/contents/edit/' . $this->frame->page_id . '/' . $this->frame->id . '/' . $this->content->id . '#frame-' . $this->frame->id)
->pause(500)
->waitFor('.tox-tinymce')
->screenshot('common/wysiwyg/pdf/images/pdf2');

// 表示画面
Expand Down
2 changes: 1 addition & 1 deletion tests/Browser/Manage/ApiManageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ private function index()
{
$this->browse(function (Browser $browser) {
$browser->visit('/manage/api')
->pause(500)
->waitFor("input[name='secret_name']")
->type('secret_name', 'テスト')
->type('secret_code', 'secret_1234')
->type('ip_address', '192.168.10.101')
Expand Down
2 changes: 1 addition & 1 deletion tests/Browser/Manage/CodeManageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ private function import()

$browser->press('インポート')
->acceptDialog()
->pause(500)
->waitForLocation('/manage/code/import')
->assertDontSee('500') // "500" 文字がない事
->screenshot('manage/code/import/images/import2');
});
Expand Down
6 changes: 2 additions & 4 deletions tests/Browser/Manage/LogManageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,8 @@ private function index()
$browser->visit('/manage/edit')
->visit('/manage/log')
->click('#app_log_search_condition_button')
->assertTitleContains('Connect-CMS');

// collapseが表示されるまで、ちょっと待つ
$browser->pause(500)
->assertTitleContains('Connect-CMS')
->waitFor('#app_log_search_condition')
->screenshot('manage/log/index/images/index3');
});

Expand Down
13 changes: 7 additions & 6 deletions tests/Browser/Manage/PageManageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ private function edit()
// クリックできるのは、label タグになるため、label タグにセレクタを追加して、ckick() メソッドで値を設定する。
$this->browse(function (Browser $browser) {
$browser->visit('/manage/page/edit')
->waitFor("input[name='page_name']")
->type('page_name', 'プラグイン・テスト')
->type('permanent_link', '/test')
->click('#label_base_display_flag')
Expand Down Expand Up @@ -166,10 +167,10 @@ private function movePage()
$browser->visit('/manage/page')
->screenshot('manage/page/movePage/images/movePage1')
->click("#move_level_" . $sub_page->id)
->pause(500)
->waitFor("#level_move_page_" . $test_page->id)
->screenshot('manage/page/movePage/images/movePage2')
->click("#level_move_page_" . $test_page->id)
->pause(500)
->waitForText('決定')
->screenshot('manage/page/movePage/images/movePage3')
->press("決定");
});
Expand Down Expand Up @@ -263,8 +264,8 @@ private function pageRole()
->clickLink('管理者グループ')
->assertSourceHas('ページ権限設定');

// collapseが表示されるまで、ちょっと待つ
$browser->pause(500);
// collapseの展開待機
$browser->waitFor("label[for='role_reporter1']");

//$this->screenshot($browser);
$browser->screenshot('manage/page/pageRole/images/pageRole');
Expand All @@ -283,8 +284,8 @@ private function pageRoleUpdate()
$browser->click("label[for='role_reporter1']")
->assertTitleContains('Connect-CMS');

// チェックボックスのクリックが反映されるまで、ちょっと待つ
$browser->pause(500);
// 反映待機(最低限、要素の存在を担保)
$browser->waitFor("label[for='role_reporter1']");

//$this->screenshot($browser);
$browser->screenshot('manage/page/pageRoleUpdate/images/pageRoleUpdate');
Expand Down
Loading
Loading