@@ -80,15 +80,20 @@ private function setPassword()
80
80
*/
81
81
private function viewPage ()
82
82
{
83
- // ログアウト
83
+ // *** ログアウト状態でパスワードページ>パスワード入力>ページの閲覧
84
84
$ this ->browse (function (Browser $ browser ) {
85
85
$ browser ->visit ('/password ' )
86
86
->assertTitleContains ('Connect-CMS ' )
87
87
->screenshot ('common/password_page/viewPage/images/viewPage1 ' )
88
88
->type ('password ' , 'pass123 ' )
89
89
->screenshot ('common/password_page/viewPage/images/inputPassword ' )
90
90
->press ('ページ閲覧 ' );
91
+ });
91
92
93
+ // *** ログインして固定記事を作成
94
+ // ※ $this->browse()内で$this->login(), $this->logout() はなるべく使わない。$this->login(), $this->logout() は内部で$this->browse()を使っているため、入れ子呼び出しになり、ログインできたり・できなかったりする事あり(github actions+php8.1等)
95
+ $ this ->login (1 );
96
+ $ this ->browse (function (Browser $ browser ) {
92
97
// データクリア
93
98
$ page = Page::where ('permanent_link ' , '/password ' )->first ();
94
99
$ frame = Frame::where ('page_id ' , $ page ->id )->where ('plugin_name ' , 'contents ' )->first ();
@@ -102,7 +107,6 @@ private function viewPage()
102
107
}
103
108
104
109
// 固定記事を作成
105
- $ this ->login (1 );
106
110
$ this ->addPluginModal ('contents ' , '/password ' , 2 , false );
107
111
$ bucket = Buckets::create (['bucket_name ' => 'パスワード付きページテスト ' , 'plugin_name ' => 'contents ' ]);
108
112
@@ -111,8 +115,12 @@ private function viewPage()
111
115
112
116
$ this ->frame = Frame::orderBy ('id ' , 'desc ' )->first ();
113
117
$ this ->frame ->update (['bucket_id ' => $ bucket ->id ]);
114
- $ this ->logout ();
118
+ });
119
+ // パスワード入力済みセッションをクリアさせないため、ログアウトしない
120
+ // $this->logout();
115
121
122
+ // *** パスワード入力済みのため、パスワード付きページの閲覧できる(固定記事あり)
123
+ $ this ->browse (function (Browser $ browser ) {
116
124
$ browser ->visit ('/password ' )
117
125
->screenshot ('common/password_page/viewPage/images/viewPage2 ' );
118
126
});
0 commit comments