Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
haydar-metin committed Feb 21, 2024
1 parent 7ab3d5f commit 0460a4b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 14 deletions.
8 changes: 0 additions & 8 deletions examples/workflow-test/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -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: {}
};
1 change: 0 additions & 1 deletion examples/workflow-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
9 changes: 5 additions & 4 deletions packages/glsp-playwright/src/glsp/graph/elements/element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ import { ModelElementMetadata, PMetadata } from '../decorators';
import { SVGMetadata } from '../svg-metadata-api';

export async function assertEqualType(element: PModelElement): Promise<void> {
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));
}

Expand Down
2 changes: 1 addition & 1 deletion packages/glsp-playwright/src/glsp/graph/graph.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down
2 changes: 2 additions & 0 deletions packages/glsp-playwright/src/utils/ts.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export function defined<T>(value: T | undefined | null): T {
export async function definedGLSPAttr(locator: GLSPLocator, attr: string): Promise<string> {
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.`);
Expand All @@ -59,6 +60,7 @@ export async function definedGLSPAttr(locator: GLSPLocator, attr: string): Promi
export async function definedAttr(locator: Locator, attr: string): Promise<string> {
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`);
Expand Down

0 comments on commit 0460a4b

Please sign in to comment.