test: Create Script JWS Branch Management
This commit is contained in:
parent
791f01a9f0
commit
61f99e7f6f
12 changed files with 674 additions and 18 deletions
|
|
@ -0,0 +1,43 @@
|
|||
import { test, expect, Page } from '@playwright/test';
|
||||
import { strictEqual } from 'assert';
|
||||
|
||||
let page: Page;
|
||||
|
||||
test.beforeAll(async ({ browser }) => {
|
||||
page = await browser.newPage();
|
||||
});
|
||||
|
||||
test.afterAll(async () => {
|
||||
if (page !== undefined) {
|
||||
await page.close();
|
||||
}
|
||||
});
|
||||
|
||||
test('Login', async () => {
|
||||
// Login
|
||||
await page.goto('http://192.168.1.90:20001/');
|
||||
await expect(page).toHaveTitle(/^Sign in to /);
|
||||
await page.fill("input[name='username']", 'admin');
|
||||
await page.fill("input[name='password']", '1234');
|
||||
await page.click('id=kc-login');
|
||||
await page.waitForTimeout(2000);
|
||||
// await page.click('id=acceptBtn');
|
||||
});
|
||||
|
||||
test('Create Branch Managenment', async () => {
|
||||
await page.click('id=menu-icon-branch-management');
|
||||
await page.click('id=hq-add-btn');
|
||||
await page.fill("(//input[@id='input-tax-no'])[2]", '1260846220284');
|
||||
await page.fill("(//input[@id='input-name'])[2]", 'สีลม');
|
||||
await page.fill("(//input[@id='input-name-en'])[2]", 'Silom');
|
||||
await page.fill("(//input[@id='input-address'])[2]", '20/02 ');
|
||||
await page.click("(//div[@id='select-province'])[2]");
|
||||
await page.click("//div[@role='option']");
|
||||
await page.click("(//div[@id='select-district'])[2]");
|
||||
await page.click("//span[text()='เมือง']");
|
||||
await page.click("(//div[@id='select-sub-district'])[2]");
|
||||
await page.click("//span[text()='ช้างเผือก']");
|
||||
await page.fill("(//input[@id='input-address-en'])[2]", '20/02');
|
||||
await page.click('id=submitBtn');
|
||||
await page.waitForTimeout(2000);
|
||||
});
|
||||
|
|
@ -0,0 +1,129 @@
|
|||
import { test, expect, Page } from '@playwright/test';
|
||||
import { strictEqual } from 'assert';
|
||||
|
||||
let page: Page;
|
||||
|
||||
test.beforeAll(async ({ browser }) => {
|
||||
page = await browser.newPage();
|
||||
});
|
||||
|
||||
test.afterAll(async () => {
|
||||
if (page !== undefined) {
|
||||
await page.close();
|
||||
}
|
||||
});
|
||||
|
||||
test('Login', async () => {
|
||||
// Login
|
||||
await page.goto('http://192.168.1.90:20001/');
|
||||
await expect(page).toHaveTitle(/^Sign in to /);
|
||||
await page.fill("input[name='username']", 'admin');
|
||||
await page.fill("input[name='password']", '1234');
|
||||
await page.click('id=kc-login');
|
||||
await page.waitForTimeout(2000);
|
||||
// await page.click('id=acceptBtn');
|
||||
});
|
||||
|
||||
test('Create Branch Managenment Not input data', async () => {
|
||||
await page.click('id=menu-icon-branch-management');
|
||||
await page.click('id=hq-add-btn');
|
||||
await page.click('id=submitBtn');
|
||||
await page.waitForTimeout(4000);
|
||||
await page.click("(//button[@id='closeDialog'])[2]");
|
||||
});
|
||||
|
||||
test('Create Branch Managenment Not input Tax', async () => {
|
||||
await page.click('id=hq-add-btn');
|
||||
await page.fill("(//input[@id='input-name'])[2]", 'สีลม');
|
||||
await page.fill("(//input[@id='input-name-en'])[2]", 'Silom');
|
||||
await page.fill("(//input[@id='input-address'])[2]", '20/02 ');
|
||||
await page.click("(//div[@id='select-province'])[2]");
|
||||
await page.click("//div[@role='option']");
|
||||
await page.click("(//div[@id='select-district'])[2]");
|
||||
await page.click("//span[text()='เมือง']");
|
||||
await page.click("(//div[@id='select-sub-district'])[2]");
|
||||
await page.click("//span[text()='ช้างเผือก']");
|
||||
await page.fill("(//input[@id='input-address-en'])[2]", '20/02');
|
||||
await page.click('id=submitBtn');
|
||||
await page.waitForTimeout(4000);
|
||||
await page.click("(//button[@id='closeDialog'])[2]");
|
||||
});
|
||||
|
||||
test('Create Branch Managenment Not input Head Office Name Thai', async () => {
|
||||
await page.click('id=hq-add-btn');
|
||||
await page.fill("(//input[@id='input-tax-no'])[2]", '1260846220284');
|
||||
await page.fill("(//input[@id='input-name-en'])[2]", 'Silom');
|
||||
await page.fill("(//input[@id='input-address'])[2]", '20/02 ');
|
||||
await page.click("(//div[@id='select-province'])[2]");
|
||||
await page.click("//div[@role='option']");
|
||||
await page.click("(//div[@id='select-district'])[2]");
|
||||
await page.click("//span[text()='เมือง']");
|
||||
await page.click("(//div[@id='select-sub-district'])[2]");
|
||||
await page.click("//span[text()='ช้างเผือก']");
|
||||
await page.fill("(//input[@id='input-address-en'])[2]", '20/02');
|
||||
await page.click('id=submitBtn');
|
||||
await page.waitForTimeout(4000);
|
||||
await page.click("(//button[@id='closeDialog'])[2]");
|
||||
});
|
||||
|
||||
test('Create Branch Managenment Not input Head Office Name ENG', async () => {
|
||||
await page.click('id=hq-add-btn');
|
||||
await page.fill("(//input[@id='input-name-en'])[2]", 'Silom');
|
||||
await page.fill("(//input[@id='input-address'])[2]", '20/02 ');
|
||||
await page.click("(//div[@id='select-province'])[2]");
|
||||
await page.click("//div[@role='option']");
|
||||
await page.click("(//div[@id='select-district'])[2]");
|
||||
await page.click("//span[text()='เมือง']");
|
||||
await page.click("(//div[@id='select-sub-district'])[2]");
|
||||
await page.click("//span[text()='ช้างเผือก']");
|
||||
await page.fill("(//input[@id='input-address-en'])[2]", '20/02');
|
||||
await page.click('id=submitBtn');
|
||||
await page.waitForTimeout(4000);
|
||||
await page.click("(//button[@id='closeDialog'])[2]");
|
||||
});
|
||||
|
||||
test('Create Branch Managenment Not input Address TH ', async () => {
|
||||
await page.click('id=hq-add-btn');
|
||||
await page.fill("(//input[@id='input-tax-no'])[2]", '1260846220284');
|
||||
await page.fill("(//input[@id='input-name'])[2]", 'สีลม');
|
||||
await page.fill("(//input[@id='input-name-en'])[2]", 'Silom');
|
||||
await page.click("(//div[@id='select-province'])[2]");
|
||||
await page.click("//div[@role='option']");
|
||||
await page.click("(//div[@id='select-district'])[2]");
|
||||
await page.click("//span[text()='เมือง']");
|
||||
await page.click("(//div[@id='select-sub-district'])[2]");
|
||||
await page.click("//span[text()='ช้างเผือก']");
|
||||
await page.fill("(//input[@id='input-address-en'])[2]", '20/02');
|
||||
await page.click('id=submitBtn');
|
||||
await page.waitForTimeout(4000);
|
||||
await page.click("(//button[@id='closeDialog'])[2]");
|
||||
});
|
||||
|
||||
test('Create Branch Managenment Not input Address ENG', async () => {
|
||||
await page.click('id=hq-add-btn');
|
||||
await page.fill("(//input[@id='input-tax-no'])[2]", '1260846220284');
|
||||
await page.fill("(//input[@id='input-name'])[2]", 'สีลม');
|
||||
await page.fill("(//input[@id='input-name-en'])[2]", 'Silom');
|
||||
await page.fill("(//input[@id='input-address'])[2]", '20/02 ');
|
||||
await page.click("(//div[@id='select-province'])[2]");
|
||||
await page.click("//div[@role='option']");
|
||||
await page.click("(//div[@id='select-district'])[2]");
|
||||
await page.click("//span[text()='เมือง']");
|
||||
await page.click("(//div[@id='select-sub-district'])[2]");
|
||||
await page.click("//span[text()='ช้างเผือก']");
|
||||
await page.click('id=submitBtn');
|
||||
await page.waitForTimeout(4000);
|
||||
await page.click("(//button[@id='closeDialog'])[2]");
|
||||
});
|
||||
|
||||
test('Create Branch Managenment Not Select Province,District,Sub-District', async () => {
|
||||
await page.click('id=hq-add-btn');
|
||||
await page.fill("(//input[@id='input-tax-no'])[2]", '1260846220284');
|
||||
await page.fill("(//input[@id='input-name'])[2]", 'สีลม');
|
||||
await page.fill("(//input[@id='input-name-en'])[2]", 'Silom');
|
||||
await page.fill("(//input[@id='input-address'])[2]", '20/02 ');
|
||||
await page.fill("(//input[@id='input-address-en'])[2]", '20/02');
|
||||
await page.click('id=submitBtn');
|
||||
await page.waitForTimeout(4000);
|
||||
await page.click("(//button[@id='closeDialog'])[2]");
|
||||
});
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
import { test, expect, Page } from '@playwright/test';
|
||||
import { strictEqual } from 'assert';
|
||||
|
||||
let page: Page;
|
||||
|
||||
test.beforeAll(async ({ browser }) => {
|
||||
page = await browser.newPage();
|
||||
});
|
||||
|
||||
test.afterAll(async () => {
|
||||
if (page !== undefined) {
|
||||
await page.close();
|
||||
}
|
||||
});
|
||||
|
||||
test('Login', async () => {
|
||||
// Login
|
||||
await page.goto('http://192.168.1.90:20001/');
|
||||
await expect(page).toHaveTitle(/^Sign in to /);
|
||||
await page.fill("input[name='username']", 'admin');
|
||||
await page.fill("input[name='password']", '1234');
|
||||
await page.click('id=kc-login');
|
||||
await page.waitForTimeout(2000);
|
||||
// await page.click('id=acceptBtn');
|
||||
});
|
||||
|
||||
test('Create Sub Branch Managenment', async () => {
|
||||
await page.click('id=menu-icon-branch-management');
|
||||
for (let i = 0; i < 10; i++) {
|
||||
await page.click('id=create-sub-branch-btn-สีลม');
|
||||
await page.fill("(//input[@id='input-tax-no'])[2]", `126084622028${i + 1}`);
|
||||
await page.fill("(//input[@id='input-name'])[2]", `สีลม${i + 1}`);
|
||||
await page.fill("(//input[@id='input-name-en'])[2]", `Silom${i + 1}`);
|
||||
await page.fill("(//input[@id='input-address'])[2]", `20/0${i + 1}`);
|
||||
await page.click("(//div[@id='select-province'])[2]");
|
||||
await page.click("//div[@role='option']");
|
||||
await page.click("(//div[@id='select-district'])[2]");
|
||||
await page.click("//span[text()='เมือง']");
|
||||
await page.click("(//div[@id='select-sub-district'])[2]");
|
||||
await page.click("//span[text()='ช้างเผือก']");
|
||||
await page.fill("(//input[@id='input-address-en'])[2]", `20/0${i + 1}`);
|
||||
await page.click('id=submitBtn');
|
||||
}
|
||||
await page.waitForTimeout(2000);
|
||||
});
|
||||
|
|
@ -0,0 +1,129 @@
|
|||
import { test, expect, Page } from '@playwright/test';
|
||||
import { strictEqual } from 'assert';
|
||||
|
||||
let page: Page;
|
||||
|
||||
test.beforeAll(async ({ browser }) => {
|
||||
page = await browser.newPage();
|
||||
});
|
||||
|
||||
test.afterAll(async () => {
|
||||
if (page !== undefined) {
|
||||
await page.close();
|
||||
}
|
||||
});
|
||||
|
||||
test('Login', async () => {
|
||||
// Login
|
||||
await page.goto('http://192.168.1.90:20001/');
|
||||
await expect(page).toHaveTitle(/^Sign in to /);
|
||||
await page.fill("input[name='username']", 'admin');
|
||||
await page.fill("input[name='password']", '1234');
|
||||
await page.click('id=kc-login');
|
||||
await page.waitForTimeout(2000);
|
||||
// await page.click('id=acceptBtn');
|
||||
});
|
||||
|
||||
test('Create Sub-Branch Managenment Not input data', async () => {
|
||||
await page.click('id=menu-icon-branch-management');
|
||||
await page.click('id=create-sub-branch-btn-สีลม');
|
||||
await page.click('id=submitBtn');
|
||||
await page.waitForTimeout(4000);
|
||||
await page.click("(//button[@id='closeDialog'])[2]");
|
||||
});
|
||||
|
||||
test('Create Sub-Branch Managenment Not input Tax', async () => {
|
||||
await page.click('id=create-sub-branch-btn-สีลม');
|
||||
await page.fill("(//input[@id='input-name'])[2]", 'สีลม');
|
||||
await page.fill("(//input[@id='input-name-en'])[2]", 'Silom');
|
||||
await page.fill("(//input[@id='input-address'])[2]", '20/02 ');
|
||||
await page.click("(//div[@id='select-province'])[2]");
|
||||
await page.click("//div[@role='option']");
|
||||
await page.click("(//div[@id='select-district'])[2]");
|
||||
await page.click("//span[text()='เมือง']");
|
||||
await page.click("(//div[@id='select-sub-district'])[2]");
|
||||
await page.click("//span[text()='ช้างเผือก']");
|
||||
await page.fill("(//input[@id='input-address-en'])[2]", '20/02');
|
||||
await page.click('id=submitBtn');
|
||||
await page.waitForTimeout(4000);
|
||||
await page.click("(//button[@id='closeDialog'])[2]");
|
||||
});
|
||||
|
||||
test('Create Sub-Branch Managenment Not input Head Office Name Thai', async () => {
|
||||
await page.click('id=create-sub-branch-btn-สีลม');
|
||||
await page.fill("(//input[@id='input-tax-no'])[2]", '1260846220284');
|
||||
await page.fill("(//input[@id='input-name-en'])[2]", 'Silom');
|
||||
await page.fill("(//input[@id='input-address'])[2]", '20/02 ');
|
||||
await page.click("(//div[@id='select-province'])[2]");
|
||||
await page.click("//div[@role='option']");
|
||||
await page.click("(//div[@id='select-district'])[2]");
|
||||
await page.click("//span[text()='เมือง']");
|
||||
await page.click("(//div[@id='select-sub-district'])[2]");
|
||||
await page.click("//span[text()='ช้างเผือก']");
|
||||
await page.fill("(//input[@id='input-address-en'])[2]", '20/02');
|
||||
await page.click('id=submitBtn');
|
||||
await page.waitForTimeout(4000);
|
||||
await page.click("(//button[@id='closeDialog'])[2]");
|
||||
});
|
||||
|
||||
test('Create Sub-Branch Managenment Not input Head Office Name ENG', async () => {
|
||||
await page.click('id=create-sub-branch-btn-สีลม');
|
||||
await page.fill("(//input[@id='input-name-en'])[2]", 'Silom');
|
||||
await page.fill("(//input[@id='input-address'])[2]", '20/02 ');
|
||||
await page.click("(//div[@id='select-province'])[2]");
|
||||
await page.click("//div[@role='option']");
|
||||
await page.click("(//div[@id='select-district'])[2]");
|
||||
await page.click("//span[text()='เมือง']");
|
||||
await page.click("(//div[@id='select-sub-district'])[2]");
|
||||
await page.click("//span[text()='ช้างเผือก']");
|
||||
await page.fill("(//input[@id='input-address-en'])[2]", '20/02');
|
||||
await page.click('id=submitBtn');
|
||||
await page.waitForTimeout(4000);
|
||||
await page.click("(//button[@id='closeDialog'])[2]");
|
||||
});
|
||||
|
||||
test('Create Sub-Branch Managenment Not input Address TH ', async () => {
|
||||
await page.click('id=create-sub-branch-btn-สีลม');
|
||||
await page.fill("(//input[@id='input-tax-no'])[2]", '1260846220284');
|
||||
await page.fill("(//input[@id='input-name'])[2]", 'สีลม');
|
||||
await page.fill("(//input[@id='input-name-en'])[2]", 'Silom');
|
||||
await page.click("(//div[@id='select-province'])[2]");
|
||||
await page.click("//div[@role='option']");
|
||||
await page.click("(//div[@id='select-district'])[2]");
|
||||
await page.click("//span[text()='เมือง']");
|
||||
await page.click("(//div[@id='select-sub-district'])[2]");
|
||||
await page.click("//span[text()='ช้างเผือก']");
|
||||
await page.fill("(//input[@id='input-address-en'])[2]", '20/02');
|
||||
await page.click('id=submitBtn');
|
||||
await page.waitForTimeout(4000);
|
||||
await page.click("(//button[@id='closeDialog'])[2]");
|
||||
});
|
||||
|
||||
test('Create Sub-Branch Managenment Not input Address ENG', async () => {
|
||||
await page.click('id=create-sub-branch-btn-สีลม');
|
||||
await page.fill("(//input[@id='input-tax-no'])[2]", '1260846220284');
|
||||
await page.fill("(//input[@id='input-name'])[2]", 'สีลม');
|
||||
await page.fill("(//input[@id='input-name-en'])[2]", 'Silom');
|
||||
await page.fill("(//input[@id='input-address'])[2]", '20/02 ');
|
||||
await page.click("(//div[@id='select-province'])[2]");
|
||||
await page.click("//div[@role='option']");
|
||||
await page.click("(//div[@id='select-district'])[2]");
|
||||
await page.click("//span[text()='เมือง']");
|
||||
await page.click("(//div[@id='select-sub-district'])[2]");
|
||||
await page.click("//span[text()='ช้างเผือก']");
|
||||
await page.click('id=submitBtn');
|
||||
await page.waitForTimeout(4000);
|
||||
await page.click("(//button[@id='closeDialog'])[2]");
|
||||
});
|
||||
|
||||
test('Create Sub-Branch Managenment Not Select Province,District,Sub-District', async () => {
|
||||
await page.click('id=create-sub-branch-btn-สีลม');
|
||||
await page.fill("(//input[@id='input-tax-no'])[2]", '1260846220284');
|
||||
await page.fill("(//input[@id='input-name'])[2]", 'สีลม');
|
||||
await page.fill("(//input[@id='input-name-en'])[2]", 'Silom');
|
||||
await page.fill("(//input[@id='input-address'])[2]", '20/02 ');
|
||||
await page.fill("(//input[@id='input-address-en'])[2]", '20/02');
|
||||
await page.click('id=submitBtn');
|
||||
await page.waitForTimeout(4000);
|
||||
await page.click("(//button[@id='closeDialog'])[2]");
|
||||
});
|
||||
|
|
@ -0,0 +1,91 @@
|
|||
import { test, expect, Page } from '@playwright/test';
|
||||
import { strictEqual } from 'assert';
|
||||
|
||||
let page: Page;
|
||||
|
||||
test.beforeAll(async ({ browser }) => {
|
||||
page = await browser.newPage();
|
||||
});
|
||||
|
||||
test.afterAll(async () => {
|
||||
if (page !== undefined) {
|
||||
await page.close();
|
||||
}
|
||||
});
|
||||
|
||||
test('Login', async () => {
|
||||
// Login
|
||||
await page.goto('http://192.168.1.90:20001/');
|
||||
await expect(page).toHaveTitle(/^Sign in to /);
|
||||
await page.fill("input[name='username']", 'admin');
|
||||
await page.fill("input[name='password']", '1234');
|
||||
await page.click('id=kc-login');
|
||||
await page.waitForTimeout(2000);
|
||||
// await page.click('id=acceptBtn');
|
||||
});
|
||||
|
||||
test('Select Type Branch Name Out', async () => {
|
||||
await page.click('id=menu-icon-branch-management');
|
||||
await page.click("//span[text()='ข้อมูลที่แสดง']");
|
||||
await page.click("(//div[@role='option'])[1]");
|
||||
await page.waitForTimeout(2000);
|
||||
});
|
||||
|
||||
test('Select Type Branch Telephone No. Out', async () => {
|
||||
await page.keyboard.press('Escape');
|
||||
await page.click("//span[text()='ข้อมูลที่แสดง']");
|
||||
await page.click("(//div[@role='option'])[2]");
|
||||
await page.waitForTimeout(2000);
|
||||
});
|
||||
test('Select Type Branch Address Out', async () => {
|
||||
await page.keyboard.press('Escape');
|
||||
await page.click("//span[text()='ข้อมูลที่แสดง']");
|
||||
await page.click("(//div[@role='option'])[3]");
|
||||
await page.waitForTimeout(2000);
|
||||
});
|
||||
test('Select Type Branch Type Out', async () => {
|
||||
await page.keyboard.press('Escape');
|
||||
await page.click("//span[text()='ข้อมูลที่แสดง']");
|
||||
await page.click("(//div[@role='option'])[4]");
|
||||
await page.waitForTimeout(2000);
|
||||
});
|
||||
|
||||
test('Select Type Branch Status Out', async () => {
|
||||
await page.keyboard.press('Escape');
|
||||
await page.click("//span[text()='ข้อมูลที่แสดง']");
|
||||
await page.click("(//div[@role='option'])[5]");
|
||||
await page.waitForTimeout(2000);
|
||||
});
|
||||
|
||||
test('Select Type Branch Name In', async () => {
|
||||
await page.keyboard.press('Escape');
|
||||
await page.click("//span[text()='ข้อมูลที่แสดง']");
|
||||
await page.click("(//div[@role='option'])[1]");
|
||||
await page.waitForTimeout(2000);
|
||||
});
|
||||
|
||||
test('Select Type Branch Telephone No. In', async () => {
|
||||
await page.keyboard.press('Escape');
|
||||
await page.click("//span[text()='ข้อมูลที่แสดง']");
|
||||
await page.click("(//div[@role='option'])[2]");
|
||||
await page.waitForTimeout(2000);
|
||||
});
|
||||
test('Select Type Branch Address In', async () => {
|
||||
await page.keyboard.press('Escape');
|
||||
await page.click("//span[text()='ข้อมูลที่แสดง']");
|
||||
await page.click("(//div[@role='option'])[3]");
|
||||
await page.waitForTimeout(2000);
|
||||
});
|
||||
test('Select Type Branch Type In', async () => {
|
||||
await page.keyboard.press('Escape');
|
||||
await page.click("//span[text()='ข้อมูลที่แสดง']");
|
||||
await page.click("(//div[@role='option'])[4]");
|
||||
await page.waitForTimeout(2000);
|
||||
});
|
||||
|
||||
test('Select Type Branch Status In', async () => {
|
||||
await page.keyboard.press('Escape');
|
||||
await page.click("//span[text()='ข้อมูลที่แสดง']");
|
||||
await page.click("(//div[@role='option'])[5]");
|
||||
await page.waitForTimeout(2000);
|
||||
});
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
import { test, expect, Page } from '@playwright/test';
|
||||
import { strictEqual } from 'assert';
|
||||
|
||||
let page: Page;
|
||||
|
||||
test.beforeAll(async ({ browser }) => {
|
||||
page = await browser.newPage();
|
||||
});
|
||||
|
||||
test.afterAll(async () => {
|
||||
if (page !== undefined) {
|
||||
await page.close();
|
||||
}
|
||||
});
|
||||
|
||||
test('Login', async () => {
|
||||
// Login
|
||||
await page.goto('http://192.168.1.90:20001/');
|
||||
await expect(page).toHaveTitle(/^Sign in to /);
|
||||
await page.fill("input[name='username']", 'admin');
|
||||
await page.fill("input[name='password']", '1234');
|
||||
await page.click('id=kc-login');
|
||||
await page.waitForTimeout(2000);
|
||||
// await page.click('id=acceptBtn');
|
||||
});
|
||||
|
||||
test('View Detail', async () => {
|
||||
await page.click('id=menu-icon-branch-management');
|
||||
await page.click('id=view-detail-btn-สีลม');
|
||||
await page.click('id=view-detail-btn-สีลม-view');
|
||||
await page.waitForTimeout(4000);
|
||||
await page.click('id=closeDialog');
|
||||
});
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
import { test, expect, Page } from '@playwright/test';
|
||||
import { strictEqual } from 'assert';
|
||||
|
||||
let page: Page;
|
||||
|
||||
test.beforeAll(async ({ browser }) => {
|
||||
page = await browser.newPage();
|
||||
});
|
||||
|
||||
test.afterAll(async () => {
|
||||
if (page !== undefined) {
|
||||
await page.close();
|
||||
}
|
||||
});
|
||||
|
||||
test('Login', async () => {
|
||||
// Login
|
||||
await page.goto('http://192.168.1.90:20001/');
|
||||
await expect(page).toHaveTitle(/^Sign in to /);
|
||||
await page.fill("input[name='username']", 'admin');
|
||||
await page.fill("input[name='password']", '1234');
|
||||
await page.click('id=kc-login');
|
||||
await page.waitForTimeout(2000);
|
||||
// await page.click('id=acceptBtn');
|
||||
});
|
||||
|
||||
test('Edit Branch', async () => {
|
||||
await page.click('id=menu-icon-branch-management');
|
||||
await page.click('id=view-detail-btn-สีลม');
|
||||
await page.click('id=view-detail-btn-สีลม-edit');
|
||||
await page.fill("(//input[@id='input-name'])[2]", 'สาทร');
|
||||
await page.fill("(//input[@id='input-name-en'])[2]", 'Sathorn');
|
||||
await page.click("(//button[@id='submitBtn'])[2]");
|
||||
await page.click('id=view-detail-btn-สาทร');
|
||||
await page.click('id=view-detail-btn-สาทร-view');
|
||||
await page.waitForTimeout(4000);
|
||||
});
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
import { test, expect, Page } from '@playwright/test';
|
||||
import { strictEqual } from 'assert';
|
||||
|
||||
let page: Page;
|
||||
|
||||
test.beforeAll(async ({ browser }) => {
|
||||
page = await browser.newPage();
|
||||
});
|
||||
|
||||
test.afterAll(async () => {
|
||||
if (page !== undefined) {
|
||||
await page.close();
|
||||
}
|
||||
});
|
||||
|
||||
test('Login', async () => {
|
||||
// Login
|
||||
await page.goto('http://192.168.1.90:20001/');
|
||||
await expect(page).toHaveTitle(/^Sign in to /);
|
||||
await page.fill("input[name='username']", 'admin');
|
||||
await page.fill("input[name='password']", '1234');
|
||||
await page.click('id=kc-login');
|
||||
await page.waitForTimeout(2000);
|
||||
// await page.click('id=acceptBtn');
|
||||
});
|
||||
|
||||
test('Close Status Branch Headquater', async () => {
|
||||
await page.click('id=menu-icon-branch-management');
|
||||
await page.click('id=view-detail-btn-สาทร');
|
||||
await page.click(
|
||||
"//div[contains(@class,'q-toggle__inner relative-position')]",
|
||||
);
|
||||
await page.waitForTimeout(2000);
|
||||
await page.keyboard.press('Escape');
|
||||
});
|
||||
|
||||
test('Open Status Branch Headquater', async () => {
|
||||
await page.click('id=view-detail-btn-สาทร');
|
||||
await page.click(
|
||||
"//div[contains(@class,'q-toggle__inner relative-position')]",
|
||||
);
|
||||
await page.waitForTimeout(2000);
|
||||
await page.keyboard.press('Escape');
|
||||
});
|
||||
|
||||
test('Close Status Sub-Branch Headquater', async () => {
|
||||
await page.click(
|
||||
"(//div[contains(@class,'q-tree__node-header relative-position')])[3]",
|
||||
);
|
||||
await page.click('id=branch-card-สาทร');
|
||||
await page.click('id=view-detail-btn-สีลม3');
|
||||
await page.click(
|
||||
"//div[contains(@class,'q-toggle__inner relative-position')]",
|
||||
);
|
||||
await page.waitForTimeout(2000);
|
||||
await page.keyboard.press('Escape');
|
||||
await page.waitForTimeout(4000);
|
||||
});
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
import { test, expect, Page } from '@playwright/test';
|
||||
import { strictEqual } from 'assert';
|
||||
|
||||
let page: Page;
|
||||
|
||||
test.beforeAll(async ({ browser }) => {
|
||||
page = await browser.newPage();
|
||||
});
|
||||
|
||||
test.afterAll(async () => {
|
||||
if (page !== undefined) {
|
||||
await page.close();
|
||||
}
|
||||
});
|
||||
|
||||
test('Login', async () => {
|
||||
// Login
|
||||
await page.goto('http://192.168.1.90:20001/');
|
||||
await expect(page).toHaveTitle(/^Sign in to /);
|
||||
await page.fill("input[name='username']", 'admin');
|
||||
await page.fill("input[name='password']", '1234');
|
||||
await page.click('id=kc-login');
|
||||
await page.waitForTimeout(2000);
|
||||
// await page.click('id=acceptBtn');
|
||||
});
|
||||
|
||||
test('Search Branch Management', async () => {
|
||||
await page.click('id=menu-icon-branch-management');
|
||||
await page.fill('id=input-Search', 'สีลม');
|
||||
await page.waitForTimeout(2000);
|
||||
await page.fill('id=input-Search', 'สีลม1');
|
||||
await page.waitForTimeout(2000);
|
||||
await page.fill('id=input-Search', 'สี');
|
||||
await page.waitForTimeout(2000);
|
||||
await page.fill('id=input-Search', '1');
|
||||
await page.waitForTimeout(2000);
|
||||
await page.fill('id=input-Search', '20/02');
|
||||
await page.waitForTimeout(2000);
|
||||
await page.fill('id=input-Search', 'เชียงใหม่');
|
||||
await page.waitForTimeout(2000);
|
||||
await page.fill('id=input-Search', 'เมือง');
|
||||
await page.waitForTimeout(2000);
|
||||
await page.fill('id=input-Search', 'ช้างเผือก');
|
||||
await page.waitForTimeout(2000);
|
||||
await page.fill('id=input-Search', 'ดำเนินการอยู่');
|
||||
await page.waitForTimeout(2000);
|
||||
await page.fill('id=input-Search', 'ปิดดำเนินการ');
|
||||
await page.waitForTimeout(2000);
|
||||
});
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test('has title', async ({ page }) => {
|
||||
await page.goto('https://playwright.dev/');
|
||||
|
||||
// Expect a title "to contain" a substring.
|
||||
await expect(page).toHaveTitle(/Playwright/);
|
||||
});
|
||||
|
||||
test('get started link', async ({ page }) => {
|
||||
await page.goto('https://playwright.dev/');
|
||||
|
||||
// Click the get started link.
|
||||
await page.getByRole('link', { name: 'Get started' }).click();
|
||||
|
||||
// Expects page to have a heading with the name of Installation.
|
||||
await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible();
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue