Skip to content

Commit

Permalink
メール設定のテストを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
nanasess committed Jan 28, 2025
1 parent 2eebf3f commit d758d22
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions e2e-tests/test/admin/basis/mail.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
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/mail.php`;
test.describe('メール設定のテストをします', () => {
test('メール設定のテストをします', async ( { adminLoginPage, page }) => {
page.on('dialog', dialog => dialog.accept());
await page.goto(url);
await page.getByRole('row', { name: 'テンプレート' }).locator('select').selectOption({ label: '取り寄せ確認メール' });
const title = faker.lorem.paragraph();
await page.getByRole('row', { name: 'メールタイトル' }).getByRole('textbox').fill(title);
const header = faker.lorem.sentences();
const footer = faker.lorem.sentences();
await page.getByRole('row', { name: 'ヘッダー' }).locator('textarea').fill(header);
await page.getByRole('row', { name: 'フッター' }).locator('textarea').fill(footer);
await page.getByRole('link', { name: 'この内容で登録する' }).click();

await test.step('登録内容を確認します' , async () => {
await page.getByRole('row', { name: 'テンプレート' }).locator('select').selectOption({ label: '取り寄せ確認メール' });
await expect(page.getByRole('row', { name: 'メールタイトル' }).getByRole('textbox')).toHaveValue(title);
await expect(page.getByRole('row', { name: 'ヘッダー' }).locator('textarea')).toHaveValue(header);
await expect(page.getByRole('row', { name: 'フッター' }).locator('textarea')).toHaveValue(footer);
});
});
});

0 comments on commit d758d22

Please sign in to comment.