test: Create Script JWS Branch Management
This commit is contained in:
parent
791f01a9f0
commit
61f99e7f6f
12 changed files with 674 additions and 18 deletions
60
package-lock.json
generated
60
package-lock.json
generated
|
|
@ -27,6 +27,7 @@
|
|||
"devDependencies": {
|
||||
"@iconify/vue": "^4.1.1",
|
||||
"@intlify/unplugin-vue-i18n": "^4.0.0",
|
||||
"@playwright/test": "^1.44.1",
|
||||
"@quasar/app-vite": "2.0.0-beta.9",
|
||||
"@types/node": "^20.12.7",
|
||||
"@typescript-eslint/eslint-plugin": "^7.6.0",
|
||||
|
|
@ -971,6 +972,21 @@
|
|||
"node": ">=14"
|
||||
}
|
||||
},
|
||||
"node_modules/@playwright/test": {
|
||||
"version": "1.44.1",
|
||||
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.44.1.tgz",
|
||||
"integrity": "sha512-1hZ4TNvD5z9VuhNJ/walIjvMVvYkZKf71axoF/uiAqpntQJXpG64dlXhoDXE3OczPuTuvjf/M5KWFg5VAVUS3Q==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"playwright": "1.44.1"
|
||||
},
|
||||
"bin": {
|
||||
"playwright": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16"
|
||||
}
|
||||
},
|
||||
"node_modules/@quasar/app-vite": {
|
||||
"version": "2.0.0-beta.9",
|
||||
"resolved": "https://registry.npmjs.org/@quasar/app-vite/-/app-vite-2.0.0-beta.9.tgz",
|
||||
|
|
@ -5690,6 +5706,50 @@
|
|||
"pathe": "^1.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/playwright": {
|
||||
"version": "1.44.1",
|
||||
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.44.1.tgz",
|
||||
"integrity": "sha512-qr/0UJ5CFAtloI3avF95Y0L1xQo6r3LQArLIg/z/PoGJ6xa+EwzrwO5lpNr/09STxdHuUoP2mvuELJS+hLdtgg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"playwright-core": "1.44.1"
|
||||
},
|
||||
"bin": {
|
||||
"playwright": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"fsevents": "2.3.2"
|
||||
}
|
||||
},
|
||||
"node_modules/playwright-core": {
|
||||
"version": "1.44.1",
|
||||
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.44.1.tgz",
|
||||
"integrity": "sha512-wh0JWtYTrhv1+OSsLPgFzGzt67Y7BE/ZS3jEqgGBlp2ppp1ZDj8c+9IARNW4dwf1poq5MgHreEM2KV/GuR4cFA==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"playwright-core": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16"
|
||||
}
|
||||
},
|
||||
"node_modules/playwright/node_modules/fsevents": {
|
||||
"version": "2.3.2",
|
||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
|
||||
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/postcss": {
|
||||
"version": "8.4.38",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz",
|
||||
|
|
|
|||
|
|
@ -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