Skip to content

[テスト] DuskテストがChrome 134系になって出るエラーの修正 #2143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 34 commits into from
Mar 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
c4aaafa
change: test>ReservationManageTest, ループの連続実行で画面表示がおいつかずエラーになる箇所を、ちょっと…
akagane99 Mar 15, 2025
5d43769
change: test>CalendarsPluginTest, 画面表示がおいつかない場合があるので、ちょっと待つ
akagane99 Mar 15, 2025
dec133b
change: test>FaqsPluginTest, 画面表示がおいつかない場合があるので、ちょっと待つ
akagane99 Mar 15, 2025
672df2c
change: test>PhotoalbumsPluginTest, 画面表示がおいつかない場合があるので、ちょっと待つ
akagane99 Mar 15, 2025
80c70b5
change: test>OpeningcalendarsPluginTest, 画面表示がおいつかない場合があるので、ちょっと待つ
akagane99 Mar 15, 2025
98cbd4a
change: test>DatabasesPluginTest, 画面表示がおいつかない場合があるので、ちょっと待つ
akagane99 Mar 15, 2025
80c214e
change: test>CalendarsPluginTest, 画面表示がおいつかない場合があるので、ちょっと待つ
akagane99 Mar 15, 2025
81bea2f
change: test, 画面表示がおいつかない場合があるので、ちょっと待つ
akagane99 Mar 15, 2025
c1da638
change: test>PasswordPageTest, $this->addPluginModal()は$this->browse(…
akagane99 Mar 15, 2025
df960bf
change: test, $this->login(), $this->logout()は$this->browse()内で使わないよう対応
akagane99 Mar 15, 2025
dc9b9d9
change: test>LinklistsPluginTest, 画面表示がおいつかない場合があるので、ちょっと待つ
akagane99 Mar 15, 2025
9186c36
change: test>OpacsPluginTest, 画面表示がおいつかない場合があるので、ちょっと待つ
akagane99 Mar 15, 2025
148169e
change: test>FaqsPluginTest, 画面表示がおいつかない場合があるので、ちょっと待つ
akagane99 Mar 15, 2025
cd78672
change: test, 画面表示がおいつかない場合があるので、ちょっと待つ
akagane99 Mar 15, 2025
0ea8090
change: test>LinklistsPluginTest, 画面表示がおいつかない場合があるので、ちょっと待つ
akagane99 Mar 15, 2025
fc571f3
change: test>FaqsPluginTest, 画面表示がおいつかない場合があるので、ちょっと待つ
akagane99 Mar 15, 2025
55d65b6
change: test>PasswordPageTest, 画面表示がおいつかない場合があるので、ちょっと待つ
akagane99 Mar 15, 2025
aee5405
change: test>OpacsPluginTest, 画面表示がおいつかない場合があるので、ちょっと待つ
akagane99 Mar 16, 2025
1509503
change: test>FaqsPluginTest, 画面表示がおいつかない場合があるので、ちょっと待つ
akagane99 Mar 16, 2025
1096e1f
change: test>FaqsPluginTest, 画面表示がおいつかない場合があるので、ちょっと待つ見直し
akagane99 Mar 16, 2025
7931505
change: test>FaqsPluginTest, github actionsでエラーになるため、一旦コメントアウト
akagane99 Mar 16, 2025
dabdc06
change: test>FaqsPluginTest, ドロップダウンを開く動作がgithub actionsでUnable to lo…
akagane99 Mar 16, 2025
661b308
change: test, 画面表示がおいつかない場合があるので、ちょっと待つ見直し
akagane99 Mar 16, 2025
3eb9721
change: test>FaqsPluginTest, screenshot追加
akagane99 Mar 16, 2025
9591f78
change: test>CalendarsPluginTest, 画面表示がおいつかない場合があるので、ちょっと待つ見直し
akagane99 Mar 16, 2025
beb3f1e
change: test>FaqsPluginTest, 画面表示がおいつかない場合があるので、ちょっと待つ見直し
akagane99 Mar 16, 2025
ba92c29
change: test>FaqsPluginTest, 画面表示がおいつかない場合があるので、ちょっと待つ見直し
akagane99 Mar 16, 2025
833903a
change: test>FaqsPluginTest, 画面表示がおいつかない場合があるので、ちょっと待つ見直し
akagane99 Mar 16, 2025
74bb0b5
change: test>PasswordPageTest, 画面表示がおいつかない場合があるので、ちょっと待つ
akagane99 Mar 16, 2025
6fe33d3
change: test>CalendarsPluginTest, 画面表示がおいつかない場合があるので、ちょっと待つ見直し
akagane99 Mar 17, 2025
cb68a3b
change: test, 画面表示がおいつかない場合があるので、ちょっと待つ見直し
akagane99 Mar 17, 2025
0d622c2
change: test>PasswordPageTest, screenshot追加
akagane99 Mar 17, 2025
e7b7833
refactor: test, $areaの値はenumsを使うよう修正
akagane99 Mar 17, 2025
a3a3b58
change: test>PasswordPageTest, 画面表示がおいつかない場合があるので、ちょっと待つ
akagane99 Mar 17, 2025
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
3 changes: 3 additions & 0 deletions tests/Browser/Common/FrameTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,9 @@ private function frameMail()
->screenshot('user/bbses/createBuckets/images/createBuckets')
->press('登録確定');

// 画面表示がおいつかない場合があるので、ちょっと待つ
$browser->pause(500);

// 一度、選択確定させる。
$bucket = Buckets::where('plugin_name', 'bbses')->first();
$browser->visit('/plugin/bbses/listBuckets/' . $page->id . '/' . $frame->id . '#frame-' . $frame->id)
Expand Down
57 changes: 29 additions & 28 deletions tests/Browser/Common/PasswordPageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@

namespace Tests\Browser\Common;

use Illuminate\Foundation\Testing\DatabaseMigrations;
use Laravel\Dusk\Browser;
use Tests\DuskTestCase;

use App\Enums\AreaType;
use App\Models\Common\Buckets;
use App\Models\Common\Frame;
use App\Models\Common\Page;
use App\Models\Core\Dusks;
use App\Models\User\Contents\Contents;

use App\Enums\PluginName;
use Laravel\Dusk\Browser;
use Tests\DuskTestCase;

/**
* パスワード付きページテスト
Expand Down Expand Up @@ -49,7 +46,8 @@ private function setPassword()
->type('password', 'pass123')
->screenshot('common/password_page/index/images/setPassword')
->scrollIntoView('footer')
->press('ページ更新');
->press('ページ更新')
->pause(500); // github actionsの安定性のためにpress後に少し待つ
});

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

// *** データクリア
$page = Page::where('permanent_link', '/password')->first();
$frame = Frame::where('page_id', $page->id)->where('plugin_name', 'contents')->first();
if (!empty($frame)) {
$bucket = Buckets::find($frame->bucket_id);
if (!empty($bucket)) {
Contents::where('bucket_id', $bucket->id)->forceDelete();
Buckets::find($bucket->id)->forceDelete();
}
$frame->forceDelete();
}

// *** ログインして固定記事を作成
// ※ $this->browse()内で$this->login(), $this->logout() はなるべく使わない。$this->login(), $this->logout() は内部で$this->browse()を使っているため、入れ子呼び出しになり、ログインできたり・できなかったりする事あり(github actions+php8.1等)
$this->login(1);
$this->browse(function (Browser $browser) {
// データクリア
$page = Page::where('permanent_link', '/password')->first();
$frame = Frame::where('page_id', $page->id)->where('plugin_name', 'contents')->first();
if (!empty($frame)) {
$bucket = Buckets::find($frame->bucket_id);
if (!empty($bucket)) {
Contents::where('bucket_id', $bucket->id)->forceDelete();
Buckets::find($bucket->id)->forceDelete();
}
$frame->forceDelete();
}

// 固定記事を作成
$this->addPluginModal('contents', '/password', 2, false);
$bucket = Buckets::create(['bucket_name' => 'パスワード付きページテスト', 'plugin_name' => 'contents']);
// 固定記事を作成
// ※ $this->browse() 入れ子対応。下記メソッドはなるべく$this->browse()内で使わない
$this->addPluginModal('contents', '/password', AreaType::main, false);

// 初めは記事は文字のみ。
$this->content = Contents::create(['bucket_id' => $bucket->id, 'content_text' => '<p>パスワード付きページのテストです。</p>', 'status' => 0]);
$bucket = Buckets::create(['bucket_name' => 'パスワード付きページテスト', 'plugin_name' => 'contents']);

// 初めは記事は文字のみ。
$content = Contents::create(['bucket_id' => $bucket->id, 'content_text' => '<p>パスワード付きページのテストです。</p>', 'status' => 0]);

$frame = Frame::orderBy('id', 'desc')->first();
$frame->update(['bucket_id' => $bucket->id]);

$this->frame = Frame::orderBy('id', 'desc')->first();
$this->frame->update(['bucket_id' => $bucket->id]);
});
// パスワード入力済みセッションをクリアさせないため、ログアウトしない
// $this->logout();

Expand Down
11 changes: 5 additions & 6 deletions tests/Browser/Common/WysiwygTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@

namespace Tests\Browser\Common;

use Illuminate\Foundation\Testing\DatabaseMigrations;
use Laravel\Dusk\Browser;
use Tests\DuskTestCase;

use App\Enums\AreaType;
use App\Models\Common\Buckets;
use App\Models\Common\Page;

use App\Models\Common\Frame;
use App\Models\Core\Dusks;
use App\Models\User\Contents\Contents;
use Laravel\Dusk\Browser;
use Tests\DuskTestCase;

/**
* WYSIWYGテスト
Expand Down Expand Up @@ -76,7 +75,7 @@ private function init()
}

// 固定記事を作成
$this->addPluginModal('contents', '/test/content', 2, false);
$this->addPluginModal('contents', '/test/content', AreaType::main, false);
$bucket = Buckets::create(['bucket_name' => 'WYSIWYGエディタ', 'plugin_name' => 'contents']);

// 初めは記事は文字のみ。
Expand Down
3 changes: 3 additions & 0 deletions tests/Browser/ConnectStudy/DroneStudyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ private function createBuckets()
->screenshot('study/dronestudies/createBuckets/images/createBuckets2')
->press('登録確定');

// 画面表示がおいつかない場合があるので、ちょっと待つ
$browser->pause(500);

// 一度、選択確定させる。
$bucket = Buckets::where('plugin_name', 'dronestudies')->first();
$browser->visit('/plugin/dronestudies/listBuckets/' . $this->test_frame->page_id . '/' . $this->test_frame->id . '#frame-' . $this->test_frame->id)
Expand Down
8 changes: 6 additions & 2 deletions tests/Browser/Manage/ReservationManageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Tests\Browser\Manage;

use Illuminate\Foundation\Testing\DatabaseMigrations;
use Laravel\Dusk\Browser;
use Tests\DuskTestCase;
use Artisan;
Expand Down Expand Up @@ -131,6 +130,9 @@ private function registOther(...$names)
$reservations_category = '3';
}

// ループの連続実行で画面表示がおいついてないので、ちょっと待つ
$browser->pause(500);

$browser->visit('/manage/reservation/regist')
->type('facility_name', $name)
->select('reservations_categories_id', $reservations_category)
Expand All @@ -150,7 +152,9 @@ private function categories()
$browser->visit('/manage/reservation/categories')
->type('add_display_sequence', '2')
->type('add_category', '会議室')
->press('変更')
->press('変更');

$browser->visit('/manage/reservation/categories')
->type('add_display_sequence', '3')
->type('add_category', 'ドローン')
->press('変更');
Expand Down
3 changes: 3 additions & 0 deletions tests/Browser/User/BbsesPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ private function createBuckets()
->screenshot('user/bbses/createBuckets/images/createBuckets')
->press('登録確定');

// 画面表示がおいつかない場合があるので、ちょっと待つ
$browser->pause(500);

// 一度、選択確定させる。
$bucket = Buckets::where('plugin_name', 'bbses')->first();
$browser->visit('/plugin/bbses/listBuckets/' . $this->test_frame->page_id . '/' . $this->test_frame->id . '#frame-' . $this->test_frame->id)
Expand Down
3 changes: 3 additions & 0 deletions tests/Browser/User/BlogsPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@ private function createBuckets()
->screenshot('user/blogs/createBuckets/images/createBuckets')
->press('登録確定');

// 画面表示がおいつかない場合があるので、ちょっと待つ
$browser->pause(500);

// 一度、選択確定させる。
$bucket = Buckets::where('plugin_name', 'blogs')->first();
$browser->visit('/plugin/blogs/listBuckets/' . $this->test_frame->page_id . '/' . $this->test_frame->id . '#frame-' . $this->test_frame->id)
Expand Down
3 changes: 3 additions & 0 deletions tests/Browser/User/CabinetsPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ private function createBuckets()
->screenshot('user/cabinets/createBuckets/images/createBuckets')
->press('登録確定');

// 画面表示がおいつかない場合があるので、ちょっと待つ
$browser->pause(500);

// 一度、選択確定させる。
$bucket = Buckets::where('plugin_name', 'cabinets')->first();
$browser->visit('/plugin/cabinets/listBuckets/' . $this->test_frame->page_id . '/' . $this->test_frame->id . '#frame-' . $this->test_frame->id)
Expand Down
19 changes: 9 additions & 10 deletions tests/Browser/User/CalendarsPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,12 @@

namespace Tests\Browser\User;

use Illuminate\Foundation\Testing\DatabaseMigrations;
use Laravel\Dusk\Browser;
use Tests\DuskTestCase;

use App\Enums\PluginName;
use App\Models\Common\Buckets;
use App\Models\Common\Frame;
use App\Models\Common\Uploads;
use App\Models\Core\Dusks;
use App\Models\User\Calendars\Calendar;
use App\Models\User\Calendars\CalendarFrame;
use App\Models\User\Calendars\CalendarPost;
use Laravel\Dusk\Browser;
use Tests\DuskTestCase;

/**
* カレンダーテスト
Expand Down Expand Up @@ -114,7 +108,8 @@ private function edit($title = null)
->type('end_date', $ym . '-01')
->type('end_time', '12:00')
->screenshot('user/calendars/edit/images/edit1')
->press('登録確定');
->press('登録確定')
->pause(500); // github actionsの安定性のためにpress後に少し待つ

$browser->visit('plugin/calendars/edit/' . $this->test_frame->page_id . '/' . $this->test_frame->id . '?date=' . $ym . '-08#frame-' . $this->test_frame->id)
->assertPathBeginsWith('/')
Expand All @@ -124,7 +119,8 @@ private function edit($title = null)
->driver->executeScript('tinyMCE.get(0).setContent(\'この予定は全日予定です。\')');

$browser->screenshot('user/calendars/edit/images/edit2')
->press('登録確定');
->press('登録確定')
->pause(500); // github actionsの安定性のためにpress後に少し待つ

$browser->visit('plugin/calendars/edit/' . $this->test_frame->page_id . '/' . $this->test_frame->id . '?date=' . $ym . '-20#frame-' . $this->test_frame->id)
->assertPathBeginsWith('/')
Expand Down Expand Up @@ -176,6 +172,9 @@ private function createBuckets()
->screenshot('user/calendars/createBuckets/images/createBuckets')
->press('登録確定');

// 画面表示がおいつかない場合があるので、ちょっと待つ
$browser->pause(500);

// 一度、選択確定させる。
$bucket = Buckets::where('plugin_name', 'calendars')->first();
$browser->visit('/plugin/calendars/listBuckets/' . $this->test_frame->page_id . '/' . $this->test_frame->id . '#frame-' . $this->test_frame->id)
Expand Down
15 changes: 7 additions & 8 deletions tests/Browser/User/CountersPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,14 @@

namespace Tests\Browser\User;

use Illuminate\Foundation\Testing\DatabaseMigrations;
use Laravel\Dusk\Browser;
use Tests\DuskTestCase;

use App\Enums\PluginName;
use App\Enums\AreaType;
use App\Models\Common\Buckets;
use App\Models\Common\Frame;
use App\Models\Common\Uploads;
use App\Models\Core\Dusks;
use App\Models\User\Counters\Counter;
use App\Models\User\Counters\CounterCount;
use App\Models\User\Counters\CounterFrame;
use Laravel\Dusk\Browser;
use Tests\DuskTestCase;

/**
* カウンターテスト
Expand All @@ -40,7 +36,7 @@ public function test()
$this->listBuckets();

// 左エリアの下にもカウンターを置く。バケツはメインエリアと同じものを参照。順番は、上にメニュー、下にカウンター
$this->addPluginModal('counters', '/', 1, false);
$this->addPluginModal('counters', '/', AreaType::left, false);
Frame::where('area_id', 1)->where('plugin_name', 'menus')->update(['display_sequence' => 1]);
$frame = Frame::where('area_id', 2)->where('plugin_name', 'counters')->first();
Frame::where('area_id', 1)->where('plugin_name', 'counters')->update(['display_sequence' => 2, 'bucket_id' => $frame->bucket_id]);
Expand Down Expand Up @@ -110,6 +106,9 @@ private function createBuckets()
->screenshot('user/counters/createBuckets/images/createBuckets')
->press("登録確定");

// 画面表示がおいつかない場合があるので、ちょっと待つ
$browser->pause(500);

// 一度、選択確定させる。
$bucket = Buckets::where('plugin_name', 'counters')->first();
$browser->visit('/plugin/counters/listBuckets/' . $this->test_frame->page_id . '/' . $this->test_frame->id . '#frame-' . $this->test_frame->id)
Expand Down
15 changes: 8 additions & 7 deletions tests/Browser/User/DatabasesPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,8 @@

namespace Tests\Browser\User;

use Illuminate\Foundation\Testing\DatabaseMigrations;
use Laravel\Dusk\Browser;
use Tests\DuskTestCase;

use App\Enums\PluginName;
use App\Models\Common\Buckets;
use App\Models\Common\Frame;
use App\Models\Common\Uploads;
use App\Models\Core\Dusks;
use App\Models\User\Databases\Databases;
use App\Models\User\Databases\DatabasesColumns;
use App\Models\User\Databases\DatabasesColumnsRole;
Expand All @@ -19,6 +12,8 @@
use App\Models\User\Databases\DatabasesInputCols;
use App\Models\User\Databases\DatabasesInputs;
use App\Models\User\Databases\DatabasesRole;
use Laravel\Dusk\Browser;
use Tests\DuskTestCase;

/**
* データベーステスト
Expand Down Expand Up @@ -253,6 +248,9 @@ private function createBuckets()
->screenshot('user/databases/createBuckets/images/createBuckets')
->press('登録確定');

// 画面表示がおいつかない場合があるので、ちょっと待つ
$browser->pause(500);

// 一度、選択確定させる。
$bucket = Buckets::where('plugin_name', 'databases')->first();
$browser->visit('/plugin/databases/listBuckets/' . $this->test_frame->page_id . '/' . $this->test_frame->id . '#frame-' . $this->test_frame->id)
Expand Down Expand Up @@ -341,6 +339,9 @@ private function editColumnDetail()
->type('column_group', '1')
->press('#button_column');

// 画面表示がおいつかない場合があるので、ちょっと待つ
$browser->pause(500);

// 都道府県名
$browser->visit('/plugin/databases/editColumnDetail/' . $this->test_frame->page_id . '/' . $this->test_frame->id . '/2#frame-' . $this->test_frame->id)
->scrollIntoView('#div_select')
Expand Down
3 changes: 3 additions & 0 deletions tests/Browser/User/DatabasesearchesPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ private function editBuckets()
->screenshot('user/databasesearches/editBuckets/images/editBuckets2')
->press("登録");

// 画面表示がおいつかない場合があるので、ちょっと待つ
$browser->pause(500);

// 一度、選択確定させる。
$bucket = Buckets::where('plugin_name', 'databasesearches')->first();
$browser->visit('/plugin/databasesearches/listBuckets/' . $this->test_frame->page_id . '/' . $this->test_frame->id . '#frame-' . $this->test_frame->id)
Expand Down
Loading