Skip to content

Commit

Permalink
Fix faker
Browse files Browse the repository at this point in the history
  • Loading branch information
nanasess committed Aug 6, 2022
1 parent f7e9b46 commit dd20a9c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions e2e-tests/test/admin/system/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { test, expect, chromium, Page } from '@playwright/test';
import { ZapClient, Mode, ContextType } from '../../../utils/ZapClient';
import * as faker from '@faker-js/faker/locale/ja';
import * as fakerEn from '@faker-js/faker/locale/en';
import { faker } from '@faker-js/faker/locale/ja';
import { faker as fakerEn } from '@faker-js/faker/locale/en';

import { ADMIN_DIR } from '../../../config/default.config';

Expand Down
16 changes: 8 additions & 8 deletions e2e-tests/test/front_guest/entry.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { test, expect, chromium, Page, request, APIRequestContext } from '@playwright/test';
import PlaywrightConfig from '../../../playwright.config';
import * as faker from '@faker-js/faker/locale/ja';
import * as fakerEN from '@faker-js/faker/locale/en_US';
import { faker } from '@faker-js/faker/locale/ja';
import { faker as fakerEN } from '@faker-js/faker/locale/en_US';
import { addYears } from 'date-fns';

const url = '/entry/kiyaku.php';
Expand Down Expand Up @@ -55,12 +55,12 @@ test.describe.serial('会員登録のテストをします', () => {
await page.selectOption('select[name=pref]', { label: faker.address.state() });
await page.fill('input[name=addr01]', faker.address.city());
await page.fill('input[name=addr02]', faker.address.streetName());
await page.fill('input[name=tel01]', faker.phone.phoneNumber('###'));
await page.fill('input[name=tel02]', faker.phone.phoneNumber('###'));
await page.fill('input[name=tel03]', faker.phone.phoneNumber('###'));
await page.fill('input[name=fax01]', faker.phone.phoneNumber('###'));
await page.fill('input[name=fax02]', faker.phone.phoneNumber('###'));
await page.fill('input[name=fax03]', faker.phone.phoneNumber('###'));
await page.fill('input[name=tel01]', faker.phone.number('###'));
await page.fill('input[name=tel02]', faker.phone.number('###'));
await page.fill('input[name=tel03]', faker.phone.number('###'));
await page.fill('input[name=fax01]', faker.phone.number('###'));
await page.fill('input[name=fax02]', faker.phone.number('###'));
await page.fill('input[name=fax03]', faker.phone.number('###'));
email = fakerEN.fake(String(Date.now()) + '.{{internet.exampleEmail}}').toLowerCase();
await page.fill('input[name=email]', email);
await page.fill('input[name=email02]', email);
Expand Down
28 changes: 14 additions & 14 deletions e2e-tests/test/front_guest/shopping.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { test, expect, chromium, Page, request, APIRequestContext } from '@playwright/test';
import PlaywrightConfig from '../../../playwright.config';
import * as faker from '@faker-js/faker/locale/ja';
import * as fakerEN from '@faker-js/faker/locale/en_US';
import { faker } from '@faker-js/faker/locale/ja';
import { faker as fakerEN } from '@faker-js/faker/locale/en_US';
import { addYears } from 'date-fns';

import { ZapClient, Mode, ContextType } from '../../utils/ZapClient';
Expand Down Expand Up @@ -63,12 +63,12 @@ test.describe.serial('購入フロー(ゲスト)のテストをします', () =>
await page.selectOption('select[name=order_pref]', { label: faker.address.state() });
await page.fill('input[name=order_addr01]', faker.address.city());
await page.fill('input[name=order_addr02]', faker.address.streetName());
await page.fill('input[name=order_tel01]', faker.phone.phoneNumber('###'));
await page.fill('input[name=order_tel02]', faker.phone.phoneNumber('###'));
await page.fill('input[name=order_tel03]', faker.phone.phoneNumber('###'));
await page.fill('input[name=order_fax01]', faker.phone.phoneNumber('###'));
await page.fill('input[name=order_fax02]', faker.phone.phoneNumber('###'));
await page.fill('input[name=order_fax03]', faker.phone.phoneNumber('###'));
await page.fill('input[name=order_tel01]', faker.phone.number('###'));
await page.fill('input[name=order_tel02]', faker.phone.number('###'));
await page.fill('input[name=order_tel03]', faker.phone.number('###'));
await page.fill('input[name=order_fax01]', faker.phone.number('###'));
await page.fill('input[name=order_fax02]', faker.phone.number('###'));
await page.fill('input[name=order_fax03]', faker.phone.number('###'));
email = fakerEN.fake(String(Date.now()) + '.{{internet.exampleEmail}}').toLowerCase();
await page.fill('input[name=order_email]', email);
await page.fill('input[name=order_email02]', email);
Expand All @@ -92,12 +92,12 @@ test.describe.serial('購入フロー(ゲスト)のテストをします', () =>
await page.selectOption('select[name=shipping_pref]', { label: faker.address.state() });
await page.fill('input[name=shipping_addr01]', faker.address.city());
await page.fill('input[name=shipping_addr02]', faker.address.streetName());
await page.fill('input[name=shipping_tel01]', faker.phone.phoneNumber('###'));
await page.fill('input[name=shipping_tel02]', faker.phone.phoneNumber('###'));
await page.fill('input[name=shipping_tel03]', faker.phone.phoneNumber('###'));
await page.fill('input[name=shipping_fax01]', faker.phone.phoneNumber('###'));
await page.fill('input[name=shipping_fax02]', faker.phone.phoneNumber('###'));
await page.fill('input[name=shipping_fax03]', faker.phone.phoneNumber('###'));
await page.fill('input[name=shipping_tel01]', faker.phone.number('###'));
await page.fill('input[name=shipping_tel02]', faker.phone.number('###'));
await page.fill('input[name=shipping_tel03]', faker.phone.number('###'));
await page.fill('input[name=shipping_fax01]', faker.phone.number('###'));
await page.fill('input[name=shipping_fax02]', faker.phone.number('###'));
await page.fill('input[name=shipping_fax03]', faker.phone.number('###'));

await page.click('[alt=上記のお届け先のみに送る]');
});
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/test/installer/installer.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { test, expect, chromium, Page } from '@playwright/test';
import * as faker from '@faker-js/faker/locale/en';
import { faker } from '@faker-js/faker/locale/en';

const baseURL = 'https://ec-cube';
const url = baseURL + '/install/';
Expand Down

0 comments on commit dd20a9c

Please sign in to comment.