feat: add unified learning workflows and six-tab assistant
This commit is contained in:
@@ -34,7 +34,7 @@ async function main() {
|
||||
await page.addScriptTag({ content: panelSource });
|
||||
await page.evaluate(() => {
|
||||
window.qaCalls = { positions: [], auto: [], copy: [], searches: [] };
|
||||
window.qaBase = { role: '主操', bankTotal: 60, roleCounts: { 主操: 20, 班长: 20, 副操: 20 }, courses: ['安全课程'], canAnswer: true, canExport: true, pageMode: 'exercise', pageStatus: '已识别练习,可以选择答案。', storageMode: 'userscript' };
|
||||
window.qaBase = { bankTotal: 60, uniqueTotal: 20, conflictTotal: 0, courses: ['安全课程'], canAnswer: true, canExport: true, pageMode: 'exercise', pageStatus: '已识别练习,可以选择答案。', storageMode: 'userscript' };
|
||||
window.qaMakePanel = partial => {
|
||||
window.qaPanel?.destroy();
|
||||
window.qaPanel = YianAssistantPanel.create({
|
||||
@@ -154,8 +154,11 @@ async function main() {
|
||||
|
||||
const beforeControls = await rect();
|
||||
const controlsSaves = await positionSaves();
|
||||
await host.getByTestId('tab-exam').click();
|
||||
await host.getByRole('switch', { name: '自动选择答案', exact: true }).click();
|
||||
await host.getByTestId('tab-settings').click();
|
||||
await host.getByRole('switch', { name: '允许复制文字', exact: true }).click();
|
||||
await host.getByTestId('tab-bank').click();
|
||||
await host.getByRole('textbox', { name: '搜索题目' }).fill('安全控制');
|
||||
await host.getByRole('textbox', { name: '搜索题目' }).press('Enter');
|
||||
assert.deepEqual(await page.evaluate(() => [qaCalls.auto, qaCalls.copy]), [[true], [false]]);
|
||||
@@ -177,6 +180,7 @@ async function main() {
|
||||
assert(clamped.top >= 0 && clamped.right <= clamped.viewportWidth + 1, '超出视口的恢复位置应钳制');
|
||||
await page.setViewportSize({ width: 390, height: 844 });
|
||||
await visible();
|
||||
await host.getByTestId('tab-bank').click();
|
||||
await page.evaluate(() => window.qaPanel.renderSearch({ total: 20, items: Array.from({ length: 20 }, (_, index) => ({ number: index + 1, type: '单选', question: '检索结果内容变高后仍应在视口内。'.repeat(4), options: [{ label: 'A', text: '安全控制' }, { label: 'B', text: '其他选项' }], answer: 'A', role: '主操', course: '安全课程' })) }));
|
||||
const grown = await visible();
|
||||
assert(grown.height <= grown.viewportHeight + 1);
|
||||
|
||||
Reference in New Issue
Block a user