-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mrc-5967 update e2e tests #229
Conversation
// const hoverElem = `.${isGlyph ? "margin-" : ""}view-overlays div:nth-child(${line}) >> div`; | ||
// const tooltipElem = `${isGlyph ? ".overlayWidgets" : ".overflowingContentWidgets"} .hover-contents div p`; | ||
await page.hover(hoverElem, { force: true }); | ||
const tooltip = await page.locator(tooltipElem); | ||
await tooltip.waitFor({ timeout: 1000 }); | ||
await expect(tooltip).toHaveText(message); | ||
await expect(tooltip).toHaveCSS("visibility", "visible"); | ||
// const tooltip = await page.locator(tooltipElem); | ||
// await tooltip.waitFor({ timeout: 2000 }); | ||
// await expect(tooltip).toHaveText(message); | ||
// await expect(tooltip).toHaveCSS("visibility", "visible"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ignore the commented out code and the block below, i remove them in the next PR, i accidentally pushed the cleaning out commented code commit to the next pr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
GH is flagging a bunch of unused imports in these files too,
let maxVariableLength = 0; | ||
const variables = graphsGetters[GraphsGetter.allSelectedVariables]; | ||
for (let i = 0; i < variables.length; i++) { | ||
maxVariableLength = Math.max(maxVariableLength, variables[i].length); | ||
} | ||
return maxVariableLength * LEGEND_WIDTH_PER_CHAR + LEGEND_LINE_PADDING; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This the change where the sort was reordering the result of the getter - because the getter result is cached and reused when some drop-down uses it? Which drop down was that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep exactly its being reused but sort also mutated the array in place, it was setting the wrong order in the select in LinkData.vue
app/static/tests/e2e/code.etest.ts
Outdated
const expectMonacoDecoration = async (state: EditorStates, line: number, numOfLines: number, page: Page) => { | ||
for (let i = 0; i < numOfLines; i += 1) { | ||
const lineElement = await page.locator(`.view-overlays div:nth-child(${i + 1}) >> div`); | ||
const glyphElement = await page.locator(`.margin-view-overlays div:nth-child(${i + 1}) >> div`); | ||
if (i === line - 1) { | ||
expect(lineElement).toHaveClass(`cdr editor-${state}-background`); | ||
expect(glyphElement.nth(0)).toHaveClass(`cgmr codicon ${editorGlyphs[state]} ${state}-glyph-style ms-1`); | ||
expect(glyphElement.nth(1)).toHaveClass("line-numbers lh-odd"); | ||
await expect(lineElement).toHaveClass(`cdr editor-${state}-background`); | ||
} else if (i === numOfLines - 1) { | ||
expect(lineElement).toHaveClass("current-line"); | ||
expect(glyphElement.nth(0)).toHaveClass("current-line current-line-margin-both"); | ||
expect(glyphElement.nth(1)).toHaveClass(/\bactive-line-number\b/); | ||
expect(glyphElement.nth(1)).toHaveClass(/\bline-numbers\b/); | ||
expect(glyphElement.nth(1)).toHaveClass(/\blh-odd\b/); | ||
await expect(lineElement).toHaveClass("current-line"); | ||
} else { | ||
expect(lineElement).toHaveCount(0); | ||
expect(glyphElement).toHaveClass("line-numbers lh-odd"); | ||
await expect(lineElement).toHaveCount(0); | ||
} | ||
} | ||
|
||
const lineHeight = await page.locator(".margin-view-overlays").evaluate(el => { | ||
return window.getComputedStyle(el).getPropertyValue("line-height"); | ||
}); | ||
const glyphTop = await page.locator(`.${editorGlyphs[state]}`).evaluate(el => { | ||
return window.getComputedStyle(el).getPropertyValue("top"); | ||
}); | ||
expect(glyphTop).toBe(`${(line - 1) * parseInt(lineHeight)}px`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this method could use some comments because I'm honestly quite confused about what's being checked for here! In the loop we're checking that there's only current-line/background styling for numOfLines
th line and its predecessor? And then the last part is checking that the glyph is on the specified line (by top)..?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep will add some comments but yh the for loop checks for the background colour of the line so the highlighting and this part is checking if the glyph is vertically aligned with the correct line number
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
// await expect((await page.innerText(":nth-match(.tooltip-inner, 2)")).trim()).toBe( | ||
// "Set 10 (or any Set [number] combination) is reserved for default set names. " + | ||
// "Please choose another set name or name this set back to its original name of 'Set 1'" | ||
// ); | ||
// await expect(await page.isVisible(".param-name-input")).toBe(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep removed in the linting PR (next one)
test.use({ | ||
permissions: ["clipboard-read", "clipboard-write"] | ||
}) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep it does! we have copy to clipboard buttons when we copy the code or link for a session and we check those like line 134 in this file
these will be solved in the next pr! (linting so seemed appropriate to wait until then) |
just updating the e2e tests here, its passing but yh 12 mins feels unacceptable considering how simple wodin is, might do a bit of work to at least get it to less than 5 mins, main changes include:
.sort
it was causing errors because sort modifies an array in place which means it mutates the array and the options displayed in dropdown are the wrong order for the e2e teststop
css prop of the glyph