feat(pda): connect online picking workflow
This commit is contained in:
@@ -10,7 +10,7 @@ test('page configuration starts at login and registers independent PDA routes',
|
||||
assert.equal(pages.pages[0].style.navigationStyle, 'custom')
|
||||
assert.deepEqual(pages.pages.map((page) => page.path), [
|
||||
'pages/login/login', 'pages/home/home', 'pages/module/module', 'pages/operation/operation',
|
||||
'pages/history/history', 'pages/profile/profile', 'pages/scanner-test/scanner-test', 'pages/picking/picking'
|
||||
'pages/tasks/tasks', 'pages/history/history', 'pages/profile/profile', 'pages/scanner-test/scanner-test', 'pages/picking/picking'
|
||||
])
|
||||
})
|
||||
|
||||
@@ -22,13 +22,28 @@ test('application uses the Vue 3 uni-app entry and no unused Android permissions
|
||||
assert.doesNotMatch(manifest, /android\.permission\.(VIBRATE|ACCESS_NETWORK_STATE)/)
|
||||
})
|
||||
|
||||
test('login is isolated and relaunches to the modular workbench', async () => {
|
||||
const login = await read('../pages/login/login.vue')
|
||||
for (const text of ['柏悦物流 · PDA作业端', '快捷登录(演示账号)', '工号 / 用户名', '作业仓库']) assert.match(login, new RegExp(text))
|
||||
assert.match(login, /signIn\(account, this\.form\.warehouse\)/)
|
||||
test('login uses the real auth endpoint and relaunches to the modular workbench', async () => {
|
||||
const [login, auth, session] = await Promise.all([read('../pages/login/login.vue'), read('../api/auth.js'), read('../stores/session.js')])
|
||||
for (const text of ['柏悦物流 · PDA作业端', '工号 / 用户名', '登录中']) assert.match(login, new RegExp(text))
|
||||
assert.doesNotMatch(login, /DEMO_ACCOUNTS|快捷登录|作业仓库/)
|
||||
assert.match(auth, /\/auth\/login/)
|
||||
assert.match(login, /loginRequest\(userId, this\.form\.password\)/)
|
||||
assert.match(login, /signInWithTokens\(tokens\)/)
|
||||
assert.match(session, /pda-auth-session/)
|
||||
assert.match(session, /claims\.app_code !== 'PLATFORM'/)
|
||||
assert.match(login, /uni\.reLaunch\(\{ url: '\/pages\/home\/home' \}\)/)
|
||||
})
|
||||
|
||||
test('picking task list uses remote loading orders and never falls back to demo tasks', async () => {
|
||||
const [tasks, home, modulePage] = await Promise.all([read('../pages/tasks/tasks.vue'), read('../pages/home/home.vue'), read('../pages/module/module.vue')])
|
||||
assert.match(tasks, /listLoadingOrders/)
|
||||
assert.match(tasks, /当前网络不可用,请联网后刷新/)
|
||||
assert.match(tasks, /进入并开始拣货/)
|
||||
assert.doesNotMatch(tasks, /demo-data|DEMO_/)
|
||||
assert.match(home, /pages\/tasks\/tasks/)
|
||||
assert.match(modulePage, /pages\/tasks\/tasks/)
|
||||
})
|
||||
|
||||
test('workbench, module, history and profile are independent sources', async () => {
|
||||
const [home, module, history, profile] = await Promise.all([
|
||||
read('../pages/home/home.vue'), read('../pages/module/module.vue'), read('../pages/history/history.vue'), read('../pages/profile/profile.vue')
|
||||
@@ -194,7 +209,7 @@ test('reusable scan target input separates field selection from page-level broad
|
||||
assert.match(picking, /handleHardwareScan\(value\)[\s\S]*?activeScanField !== 'sku'[\s\S]*?processScannedValue\(value, 'broadcast'\)/)
|
||||
})
|
||||
|
||||
test('picking session is memory-only, survives navigation and clears on logout', async () => {
|
||||
test('picking session persists per task identity and clears on logout', async () => {
|
||||
const [store, session, page] = await Promise.all([read('../stores/picking.js'), read('../stores/session.js'), read('../pages/picking/picking.vue')])
|
||||
assert.match(store, /getPickingSession/)
|
||||
assert.match(store, /savePickingSession/)
|
||||
|
||||
Reference in New Issue
Block a user