-
-
Notifications
You must be signed in to change notification settings - Fork 32
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 timeline feature error when base url is set #402
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
fc73f07
fixed error with base url
Meriem-BenIsmail 504edf2
modified filename extraction method.
Meriem-BenIsmail 6b9045a
ui test timeline
Meriem-BenIsmail 437f1e7
ui test config done.
Meriem-BenIsmail 0a96d4d
ui test for baseurl issue
Meriem-BenIsmail 65c4f28
ui test for baseurl
Meriem-BenIsmail 6fe4174
pre-commit
Meriem-BenIsmail dc4f8ff
test info
Meriem-BenIsmail c8296cc
modified script for ui tests
Meriem-BenIsmail 63348fe
removed unused cnd
Meriem-BenIsmail 42072ca
clarify condition
Meriem-BenIsmail File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright (c) Jupyter Development Team. | ||
* Distributed under the terms of the Modified BSD License. | ||
*/ | ||
|
||
/** | ||
* Configuration for Playwright using default from @jupyterlab/galata | ||
*/ | ||
const baseConfig = require('@jupyterlab/galata/lib/playwright-config'); | ||
|
||
module.exports = { | ||
...baseConfig, | ||
workers: 1, | ||
webServer: { | ||
command: 'jlpm start:timeline', | ||
url: 'http://localhost:8888/api/collaboration/timeline/lab', | ||
timeout: 120 * 1000, | ||
reuseExistingServer: !process.env.CI | ||
}, | ||
expect: { | ||
toMatchSnapshot: { | ||
maxDiffPixelRatio: 0.01 | ||
} | ||
}, | ||
projects: [ | ||
{ | ||
name: 'timeline-tests', | ||
testMatch: 'tests/**/timeline-*.spec.ts', | ||
testIgnore: '**/.ipynb_checkpoints/**', | ||
timeout: 120 * 1000 | ||
} | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,17 +23,51 @@ async function openNotebook(page: Page, notebookPath: string) { | |
await page.waitForSelector('.jp-Notebook', { state: 'visible' }); | ||
} | ||
|
||
test.describe('Open from Path', () => { | ||
|
||
test('should fail if there are console errors', async ({ page, tmpPath }) => { | ||
const isTimelineEnv = process.env.TIMELINE_FEATURE || "0"; | ||
const isTimeline = parseInt(isTimelineEnv) | ||
|
||
test.describe('Timeline Slider', () => { | ||
|
||
if (isTimeline) { | ||
test.use({ autoGoto: false }); | ||
} | ||
test('should fail if there are console errors when opening from path', async ({ page, tmpPath }) => { | ||
if (isTimeline) { | ||
console.log('Skipping this test.'); | ||
return; | ||
} | ||
const pageErrors = await capturePageErrors(page); | ||
|
||
await page.notebook.createNew(); | ||
await page.notebook.save(); | ||
await page.notebook.close(); | ||
|
||
await openNotebook(page, `${tmpPath}/Untitled.ipynb`); | ||
|
||
expect(pageErrors).toHaveLength(0); | ||
}); | ||
|
||
test('should display in status bar without console errors when baseUrl is set', async ({ page, baseURL }) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment as above. |
||
|
||
if (!isTimeline) { | ||
console.log('Skipping this test.'); | ||
return; | ||
} | ||
|
||
await page.goto('http://localhost:8888/api/collaboration/timeline') | ||
|
||
const pageErrors = await capturePageErrors(page); | ||
|
||
await page.notebook.createNew(); | ||
|
||
const historyIcon = page.locator('.jp-mod-highlighted[title="Document Timeline"]'); | ||
await expect(historyIcon).toBeVisible(); | ||
|
||
await historyIcon.click(); | ||
|
||
const slider = page.locator('.jp-timestampDisplay'); | ||
await expect(slider).toBeVisible(); | ||
|
||
expect(pageErrors).toHaveLength(0); | ||
}); | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 don't understand what this test does. It seems that you do nothing if
isTimeline
?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.
There is no need to execute this test in the added timeline test environment (with the set baseurl)
but this is the test for this PR that was merged #401