-
Notifications
You must be signed in to change notification settings - Fork 98
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
14 changed files
with
212 additions
and
15 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
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,22 @@ | ||
import { test, expect } from '@playwright/test'; | ||
import PlaywrightConfig from '../../../../playwright.config'; | ||
import { ZapClient, ContextType } from '../../../utils/ZapClient'; | ||
const zapClient = new ZapClient(); | ||
|
||
const url = `${PlaywrightConfig.use.baseURL}/admin/customer/edit.php`; | ||
test.describe.serial('会員登録画面のテストをします', () => { | ||
test.beforeAll(async () => { | ||
await zapClient.startSession(ContextType.Admin, 'admin_customer_edit') | ||
.then(async () => expect(await zapClient.isForcedUserModeEnabled()).toBeTruthy()); | ||
}); | ||
|
||
test('会員登録画面のテストをします', async ( { page }) => { | ||
await page.goto(url); | ||
await expect(page.locator('h1')).toContainText(/会員登録/); | ||
}); | ||
|
||
test('LC_Page_Admin_Customer_Edit_Ex クラスのテストをします @extends', async ( { page }) => { | ||
await page.goto(url); | ||
await expect(page.locator('h1')).toContainText(/カスタマイズ/); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -1,28 +1,28 @@ | ||
import { test, expect, chromium, Page } from '@playwright/test'; | ||
import { ADMIN_DIR } from '../../config/default.config'; | ||
import { ZapClient, ContextType } from '../../utils/ZapClient'; | ||
const zapClient = new ZapClient(); | ||
|
||
const url = `/${ADMIN_DIR}index.php`; | ||
const url = `/${ADMIN_DIR}/home.php`; | ||
|
||
test.describe.serial('管理画面に正常にログインできるか確認します', () => { | ||
test.describe.serial('管理画面Homeの確認をします', () => { | ||
let page: Page; | ||
test.beforeAll(async () => { | ||
await zapClient.startSession(ContextType.Admin, 'admin_home') | ||
.then(async () => expect(await zapClient.isForcedUserModeEnabled()).toBeTruthy()); | ||
const browser = await chromium.launch(); | ||
|
||
page = await browser.newPage(); | ||
await page.goto(url); | ||
}); | ||
|
||
test('ログイン画面を確認します', async () => { | ||
await expect(page.locator('#login-form')).toContainText(/LOGIN/); | ||
}); | ||
|
||
test('ログインします', async () => { | ||
await page.fill('input[name=login_id]', 'admin'); | ||
await page.fill('input[name=password]', 'password'); | ||
await page.click('text=LOGIN'); | ||
test('システム情報を確認します', async ({ page }) => { | ||
await page.goto(url); | ||
await expect(page.locator('.shop-info >> nth=0 >> tr >> nth=0 >> td')).toContainText('2.17'); | ||
}); | ||
|
||
test('ログインしたのを確認します', async () => { | ||
await expect(page.locator('#site-check')).toContainText('ログイン : 管理者 様'); | ||
test('LC_Page_Admin_Home_Ex クラスのテストをします @extends', async ({ page }) => { | ||
await page.goto(url); | ||
await expect(page.locator('.shop-info >> nth=0 >> tr >> nth=1 >> td')).toContainText('PHP_VERSION_ID'); | ||
}); | ||
}); |
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,28 @@ | ||
import { test, expect, chromium, Page } from '@playwright/test'; | ||
import { ADMIN_DIR } from '../../config/default.config'; | ||
|
||
const url = `/${ADMIN_DIR}index.php`; | ||
|
||
test.describe.serial('管理画面に正常にログインできるか確認します', () => { | ||
let page: Page; | ||
test.beforeAll(async () => { | ||
const browser = await chromium.launch(); | ||
|
||
page = await browser.newPage(); | ||
await page.goto(url); | ||
}); | ||
|
||
test('ログイン画面を確認します', async () => { | ||
await expect(page.locator('#login-form')).toContainText(/LOGIN/); | ||
}); | ||
|
||
test('ログインします', async () => { | ||
await page.fill('input[name=login_id]', 'admin'); | ||
await page.fill('input[name=password]', 'password'); | ||
await page.click('text=LOGIN'); | ||
}); | ||
|
||
test('ログインしたのを確認します', async () => { | ||
await expect(page.locator('#site-check')).toContainText('ログイン : 管理者 様'); | ||
}); | ||
}); |
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
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,30 @@ | ||
import { test, expect, chromium, Page } from '@playwright/test'; | ||
|
||
const url = '/index.php'; | ||
|
||
test.describe.serial('トップページのテストをします', () => { | ||
let page: Page; | ||
test.beforeAll(async () => { | ||
const browser = await chromium.launch(); | ||
page = await browser.newPage(); | ||
await page.goto(url); | ||
}); | ||
|
||
test('TOPページが正常に見られているかを確認します', async () => { | ||
await expect(page.locator('#site_description')).toHaveText('EC-CUBE発!世界中を旅して見つけた立方体グルメを立方隊長が直送!'); | ||
await expect(page.locator('#main_image')).toBeVisible(); | ||
}); | ||
|
||
test('body の class 名出力を確認します', async () => { | ||
await expect(page.locator('body')).toHaveAttribute('class', 'LC_Page_Index'); | ||
}); | ||
|
||
test('システムエラーが出ていないのを確認します', async () => { | ||
await expect(page.locator('.error')).not.toBeVisible(); | ||
}); | ||
|
||
test('LC_Page_Index_Ex クラスのテストをします @extends', async ( { page }) => { | ||
await page.goto(url); | ||
await expect(page).toHaveTitle(/カスタマイズ/); | ||
}); | ||
}); |
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,22 @@ | ||
import { test, expect } from '@playwright/test'; | ||
import PlaywrightConfig from '../../../../playwright.config'; | ||
import { ZapClient, ContextType } from '../../../utils/ZapClient'; | ||
const zapClient = new ZapClient(); | ||
|
||
const url = `${PlaywrightConfig.use.baseURL}/mypage/change.php`; | ||
test.describe.serial('会員登録内容変更画面のテストをします', () => { | ||
test.beforeAll(async () => { | ||
await zapClient.startSession(ContextType.FrontLogin, 'front_login_mypage_change') | ||
.then(async () => expect(await zapClient.isForcedUserModeEnabled()).toBeTruthy()); | ||
}); | ||
|
||
test('会員登録内容変更画面のテストをします', async ( { page }) => { | ||
await page.goto(url); | ||
await expect(page).toHaveTitle(/会員登録内容変更/); | ||
}); | ||
|
||
test('LC_Page_Mypage_Change_Ex クラスのテストをします @extends', async ( { page }) => { | ||
await page.goto(url); | ||
await expect(page).toHaveTitle(/カスタマイズ/); | ||
}); | ||
}); |
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
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
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,14 @@ | ||
<?php | ||
class LC_Page_Index_Ex extends LC_Page_Index | ||
{ | ||
public function init() | ||
{ | ||
parent::init(); | ||
$this->tpl_subtitle = '(カスタマイズ)'; | ||
} | ||
|
||
public function process() | ||
{ | ||
parent::process(); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
tests/class/fixtures/page_extends/admin/LC_Page_Admin_Home_Ex.php
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,21 @@ | ||
<?php | ||
class LC_Page_Admin_Home_Ex extends LC_Page_Admin_Home | ||
{ | ||
public function init() | ||
{ | ||
parent::init(); | ||
} | ||
|
||
public function process() | ||
{ | ||
parent::process(); | ||
} | ||
|
||
/** | ||
* @override | ||
*/ | ||
public function lfGetPHPVersion() | ||
{ | ||
return 'PHP_VERSION_ID: '.PHP_VERSION_ID; | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
tests/class/fixtures/page_extends/admin/customer/LC_Page_Admin_Customer_Edit_Ex.php
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,14 @@ | ||
<?php | ||
class LC_Page_Admin_Customer_Edit_Ex extends LC_Page_Admin_Customer_Edit | ||
{ | ||
public function init() | ||
{ | ||
parent::init(); | ||
$this->tpl_subtitle = '会員登録(カスタマイズ)'; | ||
} | ||
|
||
public function process() | ||
{ | ||
parent::process(); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
tests/class/fixtures/page_extends/admin/total/LC_Page_Admin_Total_Ex.php
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,14 @@ | ||
<?php | ||
class LC_Page_Admin_Total_Ex extends LC_Page_Admin_Total | ||
{ | ||
public function init() | ||
{ | ||
parent::init(); | ||
$this->tpl_maintitle = '売上集計(カスタマイズ)'; | ||
} | ||
|
||
public function process() | ||
{ | ||
parent::process(); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
tests/class/fixtures/page_extends/mypage/LC_Page_Mypage_Change_Ex.php
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,14 @@ | ||
<?php | ||
class LC_Page_Mypage_Change_Ex extends LC_Page_Mypage_Change | ||
{ | ||
public function init() | ||
{ | ||
parent::init(); | ||
$this->tpl_subtitle = '会員登録内容変更(カスタマイズ)'; | ||
} | ||
|
||
public function process() | ||
{ | ||
parent::process(); | ||
} | ||
} |