Skip to content

Commit

Permalink
ポイント設定のテストを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
nanasess committed Jan 27, 2025
1 parent 11eb236 commit ffc84d1
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions e2e-tests/test/admin/basis/point.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { test, expect } from '../../../fixtures/admin_login.fixture';
import { ADMIN_DIR } from '../../../config/default.config';
import { faker } from '@faker-js/faker/locale/ja';

const url = `/${ ADMIN_DIR }/basis/point.php`;
test.describe('ポイント設定のテストをします', () => {
test('ポイント設定のテストをします', async ( { adminLoginPage, page }) => {
page.on('dialog', dialog => dialog.accept());
await page.goto(url);
const pointRate = await page.getByRole('row', { name: 'ポイント付与率' }).getByRole('textbox').inputValue();
const welcomePoint = await page.getByRole('row', { name: '会員登録時付与ポイント' }).getByRole('textbox').inputValue();

await page.getByRole('row', { name: 'ポイント付与率' }).getByRole('textbox').fill(String(faker.number.int({ min: 0, max: 999 })));
await page.getByRole('row', { name: '会員登録時付与ポイント' }).getByRole('textbox').fill(String(faker.number.int({ min: 0, max: 99999999 })));

await page.getByRole('link', { name: 'この内容で登録する' }).click();

await test.step('後続のテストのために設定を戻します', async () => {
await page.getByRole('row', { name: 'ポイント付与率' }).getByRole('textbox').fill(pointRate);
await page.getByRole('row', { name: '会員登録時付与ポイント' }).getByRole('textbox').fill(welcomePoint);
await page.getByRole('link', { name: 'この内容で登録する' }).click();
});
});
});

0 comments on commit ffc84d1

Please sign in to comment.