Skip to content

Commit

Permalink
fix: ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricbet committed Oct 27, 2022
1 parent cb2a9ef commit 1d590ac
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
13 changes: 2 additions & 11 deletions tools/playwright/src/tests/language.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,13 @@ test.describe('OpenSumi Language', () => {
await folder?.open();

editor = await app.openEditor(OpenSumiTextEditor, explorer, 'language/reference.ts', false);

await app.page.waitForTimeout(400);
await editor.placeCursorInLineWithPosition(4, 20);
let cursorHandle = await editor.getCursorElement();

await cursorHandle?.click({ modifiers: [isMacintosh ? 'Meta' : 'Control'] });
await app.page.waitForTimeout(1000);
// eslint-disable-next-line no-console
console.log('definitionTree: editor.getViewElement>>. ', await (await editor.getViewElement())?.innerHTML());

const definitionTree = await explorer.getFileStatTreeNodeByPath('language/definition.ts');
// eslint-disable-next-line no-console
console.log('definitionTree: label>>. ', await definitionTree?.label());
// eslint-disable-next-line no-console
console.log('definitionTree: isSelected>>. ', await definitionTree?.isSelected());
await app.page.waitForTimeout(600);
expect(await definitionTree?.isSelected()).toBeTruthy();

const currentTab = await editor.getCurrentTab();
expect(await currentTab?.textContent()).toStrictEqual(' definition.ts');

Expand Down
2 changes: 0 additions & 2 deletions tools/playwright/src/tree-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ export class OpenSumiTreeNode {
async isSelected() {
const id = await this.elementHandle.getAttribute('data-id');
const parent = await this.parentElementHandle();
// eslint-disable-next-line no-console
console.log('parentElementHandle: >>>>', await parent?.innerHTML());
return !!(await parent?.$(`[data-id='${id}']${this.selector.selectedClass}`));
}

Expand Down
4 changes: 2 additions & 2 deletions tools/playwright/src/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ export class OpenSumiView extends OpenSumiViewBase {
}

getViewElement(): Promise<ElementHandle<SVGElement | HTMLElement> | null> {
return this.page.$(this.viewSelector);
return this.page.locator(this.viewSelector).elementHandle();
}

getTabElement(): Promise<ElementHandle<SVGElement | HTMLElement> | null> {
return this.page.$(this.tabSelector);
return this.page.locator(this.tabSelector).elementHandle();
}

async open(): Promise<OpenSumiView | undefined> {
Expand Down

0 comments on commit 1d590ac

Please sign in to comment.