diff --git a/examples/workflow-test/.eslintrc.js b/examples/workflow-test/.eslintrc.js index d92a70f..37c2321 100644 --- a/examples/workflow-test/.eslintrc.js +++ b/examples/workflow-test/.eslintrc.js @@ -1,13 +1,5 @@ /** @type {import('eslint').Linter.Config} */ module.exports = { extends: '../../.eslintrc.js', - settings: { - // Necessary for aliasing paths: https://www.typescriptlang.org/tsconfig#paths - 'import/resolver': { - typescript: { - project: ['examples/workflow-test/tsconfig.json', 'tsconfig.json'] - } - } - }, rules: {} }; diff --git a/examples/workflow-test/package.json b/examples/workflow-test/package.json index 9e7fb0b..3cea89a 100644 --- a/examples/workflow-test/package.json +++ b/examples/workflow-test/package.json @@ -50,7 +50,6 @@ "@playwright/test": "^1.40.1", "dotenv": "^16.0.3", "ts-dedent": "^2.2.0", - "tsc-alias": "^1.8.2", "tsx": "^3.12.4" }, "publishConfig": { diff --git a/packages/glsp-playwright/src/glsp/graph/elements/element.ts b/packages/glsp-playwright/src/glsp/graph/elements/element.ts index 04703b9..c932be8 100644 --- a/packages/glsp-playwright/src/glsp/graph/elements/element.ts +++ b/packages/glsp-playwright/src/glsp/graph/elements/element.ts @@ -22,12 +22,13 @@ import { ModelElementMetadata, PMetadata } from '../decorators'; import { SVGMetadata } from '../svg-metadata-api'; export async function assertEqualType(element: PModelElement): Promise { - const located = element.locate(); - const count = await located.count(); + const located = await element.locate().all(); + const count = located.length; if (count !== 1) { - for await (const locator of await located.all()) { - console.error('=========== Element =========='); + // Provide additional information + for (const locator of located) { + console.error('=========== ACCESS RETURNS =========='); console.error(await locator.evaluate(elem => elem.outerHTML)); } diff --git a/packages/glsp-playwright/src/glsp/graph/graph.po.ts b/packages/glsp-playwright/src/glsp/graph/graph.po.ts index 7d8620a..8938224 100644 --- a/packages/glsp-playwright/src/glsp/graph/graph.po.ts +++ b/packages/glsp-playwright/src/glsp/graph/graph.po.ts @@ -162,7 +162,7 @@ export class GLSPGraph extends Locateable { for await (const locator of await this.locate().locator(SVGMetadataUtils.typeAttrOf(constructor)).all()) { const id = await locator.getAttribute('id'); - if (id !== null) { + if (id !== null && (await isEqualLocatorType(locator, constructor))) { const element = await this.getEdgeBySelector(`#${id}`, constructor, options); const sourceChecks = []; const targetChecks = []; diff --git a/packages/glsp-playwright/src/utils/ts.utils.ts b/packages/glsp-playwright/src/utils/ts.utils.ts index 9ec8db9..e6669c3 100644 --- a/packages/glsp-playwright/src/utils/ts.utils.ts +++ b/packages/glsp-playwright/src/utils/ts.utils.ts @@ -48,6 +48,7 @@ export function defined(value: T | undefined | null): T { export async function definedGLSPAttr(locator: GLSPLocator, attr: string): Promise { const o = await locator.locate().getAttribute(attr); if (!isDefined(o)) { + // Provide additional information console.error('=========== Element =========='); console.error(await locator.locate().evaluate(elem => elem.outerHTML)); throw Error(`Attribute ${attr} is not defined for the selector.`); @@ -59,6 +60,7 @@ export async function definedGLSPAttr(locator: GLSPLocator, attr: string): Promi export async function definedAttr(locator: Locator, attr: string): Promise { const o = await locator.getAttribute(attr); if (!isDefined(o)) { + // Provide additional information console.error('=========== Element =========='); console.error(await locator.evaluate(elem => elem.outerHTML)); throw Error(`Attribute ${attr} is not defined for the selector`);