Skip to content

Commit 0176683

Browse files
nobuhikoclaude
andcommitted
E2Eテストのフィクスチャを既存ユーザー使用に変更
問題: - front_loginフィクスチャが毎回新規会員登録を試みていた - トランザクショントークンエラー「不正なページ移動です」が発生 - CIで30分タイムアウトが発生 解決策: - 既存のzap_user@example.comユーザーを使用するように変更 - 新規会員登録フローとポイント付与処理を削除 - シンプルにログインのみを実行 結果: - 全4テストがパス (4.7秒) - タイムアウトエラーを解消 - トランザクショントークンエラーを解消 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 3190b6e commit 0176683

File tree

1 file changed

+5
-28
lines changed

1 file changed

+5
-28
lines changed

e2e-tests/fixtures/front_login/mypage_login.fixture.ts

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,22 @@
11
import { test as base, expect } from "@playwright/test";
22
import { MypageLoginPage } from "../../pages/mypage/login.page";
3-
import { EntryPage } from "../../pages/entry/entry.page";
4-
import { AdminLoginPage } from "../../pages/admin/login.page";
53
import { Mode, ContextType } from '../../utils/ZapClient';
64
import PlaywrightConfig from '../../../playwright.config';
7-
import { ECCUBE_ADMIN_USER, ECCUBE_ADMIN_PASS, ADMIN_DIR } from "../../config/default.config";
8-
import { faker } from '@faker-js/faker/locale/ja';
9-
import { FakerUtils } from "../../utils/FakerUtils";
5+
import { ECCUBE_DEFAULT_USER, ECCUBE_DEFAULT_PASS } from "../../config/default.config";
106

117
type MypageLoginFixtures = {
128
mypageLoginPage: MypageLoginPage;
139
};
1410

1511
export const test = base.extend<MypageLoginFixtures>({
1612
mypageLoginPage: async ({ page }, use) => {
17-
const email = FakerUtils.createEmail();
18-
const password = FakerUtils.createPassword();
13+
// 既存のzap_user@example.comユーザーを使用
14+
const email = ECCUBE_DEFAULT_USER;
15+
const password = ECCUBE_DEFAULT_PASS;
1916
const loginPage = new MypageLoginPage(page, email, password);
2017
if (PlaywrightConfig.use?.proxy === undefined) {
21-
const entryPage = new EntryPage(page, email, password);
22-
await entryPage.goto();
23-
await entryPage.agree();
24-
await entryPage.fill();
25-
await entryPage.confirm();
26-
await entryPage.register();
18+
// マイページログインページに移動してログイン
2719
await loginPage.goto();
28-
await loginPage.logout();
29-
30-
// 購入フローのテストでポイント利用するため、ポイントを加算する
31-
const adminLoginPage = new AdminLoginPage(page);
32-
await page.goto(`/${ADMIN_DIR}`);
33-
await adminLoginPage.login(ECCUBE_ADMIN_USER, ECCUBE_ADMIN_PASS);
34-
await page.goto(`/${ADMIN_DIR}/customer/index.php`);
35-
await page.locator('input[name=search_email]').fill(email);
36-
await page.getByRole('link', { name: 'この条件で検索する' }).click();
37-
await page.getByRole('link', { name: '編集' }).click();
38-
await page.getByRole('row', { name: '所持ポイント' }).getByRole('textbox').fill(String(faker.number.int({ min: 0, max: 999999 })));
39-
await page.getByRole('link', { name: '確認ページへ' }).click();
40-
await page.getByRole('link', { name: 'この内容で登録する' }).click();
41-
42-
await page.goto(`/`);
4320
await loginPage.login();
4421
} else {
4522
const zapClient = loginPage.getZapClient();

0 commit comments

Comments
 (0)