forked from EC-CUBE/ec-cube2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); | ||
}); | ||
}); |