pre auto insert
This commit is contained in:
5
mainpage.po.ts_empty
Normal file
5
mainpage.po.ts_empty
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
import { Util } from "../util";
|
||||||
|
|
||||||
|
export class Mainpage {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,3 +1,13 @@
|
|||||||
mainpage.navbuttons.click();
|
mainpage.navbuttons.click();
|
||||||
mainpage.navbuttons.click();
|
mainpage.navbuttons.click();
|
||||||
mainpage.navbuttons.click();
|
mainpage.navbuttons.click();
|
||||||
|
mainpage.openmenu.click();
|
||||||
|
mainpage.menubutton.click();
|
||||||
|
mainpage.navbuttons.click();
|
||||||
|
mainpage.navbuttons.click();
|
||||||
|
mainpage.navbuttons.click();
|
||||||
|
mainpage.treenode.click();
|
||||||
|
mainpage.navbuttons.click();
|
||||||
|
mainpage.navbuttons.click();
|
||||||
|
mainpage.navbuttons.click();
|
||||||
|
mainpage.inputfield.click();
|
||||||
|
|||||||
20
server.ts
20
server.ts
@@ -75,17 +75,23 @@ function appendSuggestion(data: any) {
|
|||||||
if (data.id) lines.push(`static ${name}id = "#${data.id}"`);
|
if (data.id) lines.push(`static ${name}id = "#${data.id}"`);
|
||||||
if (data.ariaLabel) lines.push(`static ${name}aria = "[aria-label='${data.ariaLabel}']"`);
|
if (data.ariaLabel) lines.push(`static ${name}aria = "[aria-label='${data.ariaLabel}']"`);
|
||||||
lines.push(``);
|
lines.push(``);
|
||||||
lines.push(`// Suggested get function (use whichever selector fits best):`);
|
lines.push(`// Suggested get function:`);
|
||||||
|
|
||||||
// Prefer aria > id > class for the get function selector variable
|
// Selector: aria if available, otherwise class
|
||||||
const selectorVar = data.ariaLabel
|
const selectorVar = data.ariaLabel ? `Mainpage.${name}aria` : `Mainpage.${name}class`;
|
||||||
? `Mainpage.${name}aria`
|
|
||||||
: data.id
|
// Always include text and tag if available
|
||||||
? `Mainpage.${name}id`
|
const hasText = data.text && data.text.length > 0;
|
||||||
: `Mainpage.${name}class`;
|
const filterParts: string[] = [];
|
||||||
|
if (data.tag) filterParts.push(`data.tag: "${data.tag}"`);
|
||||||
|
if (hasText) filterParts.push(`text: "${data.text}"`);
|
||||||
|
|
||||||
lines.push(`get ${name}() {`);
|
lines.push(`get ${name}() {`);
|
||||||
|
if (hasText) {
|
||||||
|
lines.push(` return cy.nccontains(${selectorVar}, '${data.text}');`);
|
||||||
|
} else {
|
||||||
lines.push(` return cy.get(${selectorVar});`);
|
lines.push(` return cy.get(${selectorVar});`);
|
||||||
|
}
|
||||||
lines.push(`}`);
|
lines.push(`}`);
|
||||||
lines.push(``);
|
lines.push(``);
|
||||||
lines.push(`// ------------------------------------------------`);
|
lines.push(`// ------------------------------------------------`);
|
||||||
|
|||||||
0
suggestions.txt
Normal file
0
suggestions.txt
Normal file
Reference in New Issue
Block a user