-
Notifications
You must be signed in to change notification settings - Fork 7
Transform scrollview jest tests into playwright (#598) #649
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
Open
lukasbriza
wants to merge
3
commits into
next
Choose a base branch
from
refactoring/scrollview-jest-to-playwright
base: next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
350 changes: 350 additions & 0 deletions
350
src/components/ScrollView/__tests__/ScrollView.spec.tsx
This file contains hidden or 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,350 @@ | ||
import React from 'react'; | ||
import { | ||
expect, | ||
test, | ||
} from '@playwright/experimental-ct-react'; | ||
import { | ||
mixPropTests, | ||
propTests, | ||
} from '../../../../tests/playwright'; | ||
import { | ||
ScrollViewForDetectEndAutoscrollTest, | ||
ScrollViewForRefTest, | ||
ScrollViewForTest, | ||
} from './ScrollView.story'; | ||
import { directionPropTest } from './_propTests/directionPropTest'; | ||
import { nextArrowColorPropTest } from './_propTests/nextArrowColorPropTest'; | ||
import { nextArrowElementPropTest } from './_propTests/nextArrowElementPropTest'; | ||
import { prevArrowColorPropTest } from './_propTests/prevArrowColorPropTest'; | ||
import { prevArrowElementPropTest } from './_propTests/prevArrowElementPropTest'; | ||
import { endShadowSizePropTest } from './_propTests/endShadowSizePropTest'; | ||
import { startShadowSizePropTest } from './_propTests/startShadowSizePropTest'; | ||
import { mixArrowsDirectionPropTest } from './_propTests/mixes/mixArrowsDirectionPropTest'; | ||
import { mixEndShadowBackgroundDirectionPropTest } from './_propTests/mixes/mixEndShadowBackgroundDirectionPropTest'; | ||
import { mixStartShadowBackgroundDirectionPropTest } from './_propTests/mixes/mixStartShadowBackgroundDirectionPropTest'; | ||
import { shadowsPropTest } from './_propTests/shadowsPropTest'; | ||
import type { ExtendedWindow } from './types'; | ||
|
||
test.describe('ScrollView', () => { | ||
lukasbriza marked this conversation as resolved.
Show resolved
Hide resolved
|
||
test.describe('visual', () => { | ||
[ | ||
...propTests.defaultComponentPropTest, | ||
...mixArrowsDirectionPropTest, | ||
...mixEndShadowBackgroundDirectionPropTest, | ||
...mixPropTests([ | ||
endShadowSizePropTest, | ||
directionPropTest, | ||
]), | ||
...nextArrowColorPropTest, | ||
...nextArrowElementPropTest, | ||
...prevArrowColorPropTest, | ||
...prevArrowElementPropTest, | ||
...shadowsPropTest, | ||
...mixStartShadowBackgroundDirectionPropTest, | ||
...mixPropTests([ | ||
startShadowSizePropTest, | ||
directionPropTest, | ||
]), | ||
].forEach(({ | ||
name, | ||
onBeforeTest, | ||
onBeforeSnapshot, | ||
props, | ||
}) => { | ||
test(name, async ({ | ||
mount, | ||
page, | ||
}) => { | ||
if (onBeforeTest) { | ||
await onBeforeTest(page); | ||
} | ||
|
||
const component = await mount( | ||
<ScrollViewForTest | ||
{...props} | ||
/>, | ||
); | ||
|
||
/** | ||
* Because onBeforeSnapshot is not propagated through mixPropTests | ||
*/ | ||
if ( | ||
props?.startShadowBackground !== undefined | ||
|| props?.startShadowSize !== undefined | ||
) { | ||
await page.evaluate((id) => { | ||
(window as ExtendedWindow).scrollEnd = false; | ||
const parent = document.getElementById(id); | ||
parent.children[0].addEventListener('scrollend', () => { | ||
(window as ExtendedWindow).scrollEnd = true; | ||
}, { once: true }); | ||
}, 'scrollbar'); | ||
|
||
if (props?.direction === 'horizontal') { | ||
await page.evaluate((id) => { | ||
const parent = document.getElementById(id); | ||
parent.children[0].scrollLeft += 124; | ||
}, 'scrollbar'); | ||
} else { | ||
await page.evaluate((id) => { | ||
const parent = document.getElementById(id); | ||
parent.children[0].scrollTop += 124; | ||
}, 'scrollbar'); | ||
} | ||
|
||
await page.waitForFunction(() => (window as ExtendedWindow).scrollEnd === true); | ||
} | ||
|
||
if (onBeforeSnapshot) { | ||
await onBeforeSnapshot(page, component); | ||
} | ||
|
||
const screenshot = await component.screenshot({ animations: 'disabled' }); | ||
expect(screenshot).toMatchSnapshot(); | ||
}); | ||
}); | ||
}); | ||
|
||
test.describe('non-visual', () => { | ||
test('id', async ({ mount }) => { | ||
const id = 'testId'; | ||
|
||
const component = await mount( | ||
<ScrollViewForTest | ||
arrows | ||
id={id} | ||
/>, | ||
); | ||
|
||
expect(component.locator(`div[id="${id}"]`)).toBeDefined(); | ||
expect(component.locator(`div[id="${id}__content"]`)).toBeDefined(); | ||
expect(component.locator(`div[id="${id}__arrowPrevButton"]`)).toBeDefined(); | ||
expect(component.locator(`div[id="${id}__arrowNextButton"]`)).toBeDefined(); | ||
}); | ||
|
||
test('ref', async ({ mount }) => { | ||
const id = 'testId'; | ||
|
||
const component = await mount( | ||
<ScrollViewForRefTest | ||
id={id} | ||
testRefAttrName="test-ref" | ||
testRefAttrValue="test-ref-value" | ||
/>, | ||
); | ||
|
||
const refValue = await component.evaluate((_, idArg) => document.getElementById(idArg).firstElementChild.getAttribute('test-ref'), id); | ||
|
||
expect(refValue).toBe('test-ref-value'); | ||
}); | ||
}); | ||
|
||
test.describe('functionality', () => { | ||
test('scroll by arrowScrollStep when click on arrow', async ({ | ||
mount, | ||
page, | ||
}) => { | ||
const id = 'testId'; | ||
|
||
const component = await mount( | ||
<ScrollViewForTest | ||
arrows | ||
arrowsScrollStep={600} | ||
id={id} | ||
/>, | ||
); | ||
|
||
const arrow = component.locator(`button[id="${id}__arrowNextButton"]`); | ||
await page.evaluate((idArg) => { | ||
const parent = document.getElementById(idArg); | ||
parent.children[0].setAttribute('style', 'scroll-behavior: unset;'); | ||
}, id); | ||
const scroll = component.locator(`div[id="${id}"] > div:first-child`); | ||
await arrow.click(); | ||
|
||
const atrValue = await scroll.evaluate((element) => element.scrollTop); | ||
|
||
expect(atrValue).toBe(600); | ||
}); | ||
|
||
test('scroll at end when content change and autoScroll is "always"', async ({ | ||
mount, | ||
page, | ||
}) => { | ||
const id = 'testId'; | ||
|
||
const component = await mount( | ||
<ScrollViewForTest | ||
autoScroll="always" | ||
id={id} | ||
/>, | ||
); | ||
|
||
await page.evaluate((idArg) => { | ||
(window as ExtendedWindow).scrollEnd = false; | ||
const parent = document.getElementById(idArg); | ||
parent.children[0].setAttribute('style', 'scroll-behavior: unset;'); | ||
}, id); | ||
|
||
await page.evaluate((idArg) => { | ||
const parent = document.getElementById(idArg); | ||
parent.children[0].addEventListener('scrollend', () => { | ||
(window as ExtendedWindow).scrollEnd = true; | ||
}); | ||
parent.children[0].textContent += 'content fragment content fragment content fragment'; | ||
}, id); | ||
|
||
await page.waitForFunction(() => (window as ExtendedWindow).scrollEnd === true); | ||
|
||
const scroll = component.locator(`div[id="${id}"] > div:first-child`); | ||
const atrValue = await scroll.evaluate((element) => element.scrollTop); | ||
|
||
expect(atrValue).not.toBe(0); | ||
}); | ||
|
||
test('scroll at end when scrolled down and content change and autoScroll is "detectEnd"', async ({ | ||
mount, | ||
page, | ||
}) => { | ||
const id = 'testId'; | ||
let initialScrollTop = 0; | ||
|
||
await page.exposeFunction('onScrollEnd', (value: number) => { | ||
initialScrollTop = value; | ||
}); | ||
|
||
const component = await mount( | ||
<ScrollViewForDetectEndAutoscrollTest | ||
id={id} | ||
/>, | ||
); | ||
|
||
/** | ||
* First need to wait for initial scroll down. | ||
*/ | ||
await page.evaluate((idArg) => { | ||
(window as ExtendedWindow).scrollEnd = false; | ||
|
||
const parent = document.getElementById(idArg); | ||
parent.children[0].addEventListener('scrollend', () => { | ||
(window as ExtendedWindow).scrollEnd = true; | ||
(window as ExtendedWindow)?.onScrollEnd(parent.children[0].scrollTop); | ||
}, { once: true }); | ||
}, id); | ||
|
||
await page.waitForFunction(() => (window as ExtendedWindow).scrollEnd === true); | ||
|
||
/** | ||
* Add scroll detect setup. | ||
*/ | ||
await page.evaluate((idArg) => { | ||
(window as ExtendedWindow).scrollEnd = false; | ||
const parent = document.getElementById(idArg); | ||
parent.children[0].addEventListener('scrollend', () => { | ||
(window as ExtendedWindow).scrollEnd = true; | ||
}); | ||
}, id); | ||
|
||
const button = component.getByRole('button'); | ||
await button.click(); | ||
|
||
/** | ||
* Wait for scroll down. | ||
*/ | ||
await page.waitForFunction(() => (window as ExtendedWindow).scrollEnd === true); | ||
|
||
const scrollTopAfter = await page.evaluate((idArg) => { | ||
const parent = document.getElementById(idArg); | ||
return parent.children[0].scrollTop; | ||
}, id); | ||
|
||
expect(scrollTopAfter).toBeGreaterThan(initialScrollTop); | ||
}); | ||
|
||
test('do not display top arrow after scroll before debounce expires', async ({ | ||
mount, | ||
page, | ||
}) => { | ||
const id = 'testId'; | ||
const debounceTimeout = 2000; | ||
|
||
const component = await mount( | ||
<ScrollViewForTest | ||
arrows | ||
debounce={debounceTimeout} | ||
id={id} | ||
/>, | ||
); | ||
|
||
/** | ||
* Setup scroll down listener. | ||
*/ | ||
await page.evaluate((idArg) => { | ||
(window as ExtendedWindow).scrollEnd = false; | ||
const parent = document.getElementById(idArg); | ||
parent.children[0].addEventListener('scrollend', () => { | ||
(window as ExtendedWindow).scrollEnd = true; | ||
}, { once: true }); | ||
}, id); | ||
|
||
/** | ||
* Scroll down | ||
*/ | ||
await page.evaluate((idArg) => { | ||
const parent = document.getElementById(idArg); | ||
parent.children[0].scrollTop += 200; | ||
}, id); | ||
await page.waitForFunction(() => (window as ExtendedWindow).scrollEnd === true); | ||
|
||
const bottomArrowAfter = component.locator(`button[id="${id}__arrowPrevButton"]`); | ||
await expect(bottomArrowAfter).not.toBeVisible(); | ||
}); | ||
|
||
test('do not display bottom arrow after scroll when debounce expires', async ({ | ||
mount, | ||
page, | ||
}) => { | ||
const id = 'testId'; | ||
const debounceTimeout = 5000; | ||
|
||
const component = await mount( | ||
<ScrollViewForTest | ||
arrows | ||
debounce={debounceTimeout} | ||
id={id} | ||
/>, | ||
); | ||
|
||
/** | ||
* Setup scroll down listener. | ||
*/ | ||
await page.evaluate((idArg) => { | ||
(window as ExtendedWindow).scrollEnd = false; | ||
const parent = document.getElementById(idArg); | ||
parent.children[0].addEventListener('scrollend', () => { | ||
(window as ExtendedWindow).scrollEnd = true; | ||
}, { once: true }); | ||
}, id); | ||
|
||
/** | ||
* Scroll down | ||
*/ | ||
await page.evaluate((idArg) => { | ||
const parent = document.getElementById(idArg); | ||
parent.children[0].scrollTop = parent.children[0].children[0].clientHeight; | ||
}, id); | ||
await page.waitForFunction(() => (window as ExtendedWindow).scrollEnd === true); | ||
|
||
const bottomArrowBefore = component.locator(`button[id="${id}__arrowNextButton"]`); | ||
await expect(bottomArrowBefore).toBeVisible(); | ||
|
||
/** | ||
* Wait on debounce timeout to expire. | ||
*/ | ||
await page.waitForTimeout(1.5 * debounceTimeout); | ||
|
||
const bottomArrowAfter = component.locator(`button[id="${id}__arrowNextButton"]`); | ||
await expect(bottomArrowAfter).not.toBeVisible(); | ||
}); | ||
}); | ||
}); |
Binary file added
BIN
+31.9 KB
...x-snapshots/ScrollView-visual-defaultComponentProps-object-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.88 KB
...ew-visual-direction-string-horizontal-arrows-boolean-false-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.99 KB
...iew-visual-direction-string-horizontal-arrows-boolean-true-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.56 KB
...tion-string-horizontal-endShadowBackground-string-gradient-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.89 KB
...on-string-horizontal-startShadowBackground-string-gradient-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+40 KB
...View-visual-direction-string-vertical-arrows-boolean-false-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+40.3 KB
...lView-visual-direction-string-vertical-arrows-boolean-true-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+33.3 KB
...ection-string-vertical-endShadowBackground-string-gradient-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+34 KB
...tion-string-vertical-startShadowBackground-string-gradient-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.04 KB
...sual-endShadowSize-string-10vh-direction-string-horizontal-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+22.7 KB
...visual-endShadowSize-string-10vh-direction-string-vertical-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.66 KB
...sual-endShadowSize-string-20px-direction-string-horizontal-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+28.1 KB
...visual-endShadowSize-string-20px-direction-string-vertical-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.93 KB
...visual-endShadowSize-string-30-direction-string-horizontal-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+21.8 KB
...w-visual-endShadowSize-string-30-direction-string-vertical-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.19 KB
...isual-endShadowSize-string-4em-direction-string-horizontal-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+22.7 KB
...-visual-endShadowSize-string-4em-direction-string-vertical-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.88 KB
...sual-endShadowSize-string-6rem-direction-string-horizontal-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+20.2 KB
...visual-endShadowSize-string-6rem-direction-string-vertical-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+32.1 KB
...x-snapshots/ScrollView-visual-nextArrowColor-string-C67FAE-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+32.1 KB
...crollView-visual-nextArrowColor-string-hsl-108-48-00-50-20-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+32.1 KB
....tsx-snapshots/ScrollView-visual-nextArrowColor-string-red-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+32.1 KB
...pshots/ScrollView-visual-nextArrowColor-string-rgb-0-4-255-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+31 KB
...hots/ScrollView-visual-nextArrowElement-node-customElement-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+32.3 KB
...tsx-snapshots/ScrollView-visual-nextArrowElement-node-icon-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+33.7 KB
...x-snapshots/ScrollView-visual-nextArrowElement-node-string-1-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+32.8 KB
...x-snapshots/ScrollView-visual-prevArrowColor-string-C67FAE-1-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+32.8 KB
...crollView-visual-prevArrowColor-string-hsl-108-48-00-50-20-1-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+32.7 KB
....tsx-snapshots/ScrollView-visual-prevArrowColor-string-red-1-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+32.7 KB
...pshots/ScrollView-visual-prevArrowColor-string-rgb-0-4-255-1-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+32.3 KB
...hots/ScrollView-visual-prevArrowElement-node-customElement-1-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+33 KB
...tsx-snapshots/ScrollView-visual-prevArrowElement-node-icon-1-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+34.3 KB
...x-snapshots/ScrollView-visual-prevArrowElement-node-string-1-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+30.4 KB
...spec.tsx-snapshots/ScrollView-visual-shadows-boolean-false-1-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+31.9 KB
....spec.tsx-snapshots/ScrollView-visual-shadows-boolean-true-1-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+4.67 KB
...al-startShadowSize-string-10vh-direction-string-horizontal-1-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+23.6 KB
...sual-startShadowSize-string-10vh-direction-string-vertical-1-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+5.11 KB
...al-startShadowSize-string-20px-direction-string-horizontal-1-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+28.8 KB
...sual-startShadowSize-string-20px-direction-string-vertical-1-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+4.67 KB
...sual-startShadowSize-string-30-direction-string-horizontal-1-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+23 KB
...visual-startShadowSize-string-30-direction-string-vertical-1-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+4.74 KB
...ual-startShadowSize-string-4em-direction-string-horizontal-1-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+23.6 KB
...isual-startShadowSize-string-4em-direction-string-vertical-1-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+4.43 KB
...al-startShadowSize-string-6rem-direction-string-horizontal-1-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+21 KB
...sual-startShadowSize-string-6rem-direction-string-vertical-1-chromium-linux.png
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.