Skip to content
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

fix(e2e-test): should not wait for selector when there is no onboarding button #8212

Merged
merged 2 commits into from Jan 5, 2023

Conversation

situ2001
Copy link
Collaborator

@situ2001 situ2001 commented Jan 4, 2023

This bug was found when I want to perform a single e2e test instead of all.

If we test just a single e2e test in debug mode(both debug and non-debug mode fails, debug mode is just used to
demonstrate how I found where the bug occurs), the test will be failed and we will be breaked at this line.

await page.waitForSelector('strong:has-text("Choose a folder")', { state: 'visible', timeout: 5000 })

Here is screen recording.

Kapture.2023-01-04.at.13.51.48.mp4

I have also found that the test dir is loaded by these codes so that simply clicking on Add new graph will automatically load the test graph.

logseq/e2e-tests/utils.ts

Lines 148 to 161 in 86b5c9d

export async function setMockedOpenDirPath(
page: Page,
path?: string
): Promise<void> {
// set next open directory
await page.evaluate(
([path]) => {
Object.assign(window, {
__MOCKED_OPEN_DIR_PATH__: path,
})
},
[path]
)
}

#?(:cljs
(defn mocked-open-dir-path
"Mocked open DIR path for by-passing open dir in electron during testing. Nil if not given"
[]
(when (electron?) (. js/window -__MOCKED_OPEN_DIR_PATH__))))

After fixing this bug.

Kapture.2023-01-04.at.13.57.32.mp4

@github-actions github-actions bot added the fix label Jan 4, 2023
@situ2001 situ2001 changed the title fix(e2e): should not wait for selector when there is no onboarding button fix(e2e-test): should not wait for selector when there is no onboarding button Jan 4, 2023
@Bad3r Bad3r added the looking-for-review PRs that requires attention label Jan 4, 2023
Copy link
Collaborator

@andelf andelf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@andelf
Copy link
Collaborator

andelf commented Jan 5, 2023

Nice catch

@andelf andelf merged commit 2657f5a into logseq:master Jan 5, 2023
@Bad3r Bad3r added the :type/dev This label is used to indicate that an issue or PR is related to development tasks or changes that label Jan 5, 2023
@Bad3r Bad3r added this to the 0.8.16 milestone Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix looking-for-review PRs that requires attention :type/dev This label is used to indicate that an issue or PR is related to development tasks or changes that
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants