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

End-to-end testing #361

Closed
wants to merge 219 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
219 commits
Select commit Hold shift + click to select a range
5cb7721
Mild refactoring and new router setup
May 12, 2024
c94a62e
Added support for requesting aspect ratios to visualizers
May 13, 2024
36f3f48
Fixed bug in router
May 13, 2024
c967f5c
Merge branch 'restructuring' into 'dev'
May 13, 2024
d23c4a4
Merge pull request #1 from kaldis-berzins/restructuring
maxd0328 May 13, 2024
f9c0ce5
Default implementation of aspect ratio in P5 visualizer template
May 14, 2024
5a72930
Merge branch 'restructuring' into 'dev'
May 14, 2024
4c8e3c3
Merge pull request #2 from kaldis-berzins/restructuring
maxd0328 May 14, 2024
c9c22ea
Merge pull request #3 from kaldis-berzins/dev
maxd0328 May 14, 2024
ff70a84
Merge branch 'dev' into 'main'
May 14, 2024
a88377d
Added pipeline
May 14, 2024
a13d1ce
Merge branch 'dev' into 'main'
May 14, 2024
8e817c3
Added fonts and some basic variables
May 15, 2024
7b9faf3
removed old views and components
May 16, 2024
49b6a52
Fixed eslint errors
May 16, 2024
ceb3bc0
swapped postcss for scss and styled navbar
May 16, 2024
3aacf57
Made gallery and scope use the correct style settings
May 16, 2024
3af13ed
added tab component
ziggybeijer May 19, 2024
e4d67a6
added dropzones and a view to show demonstrate
ziggybeijer May 19, 2024
0794fdb
Added view to router. Go to /dragAndDrop to see demonstration
ziggybeijer May 19, 2024
587e6e0
Added a gallery template for mobile with fixed specimens
Gidioot May 19, 2024
b6612b8
View cards for specimens first steps
May 19, 2024
f57722e
Added a gallery template for desktop with fixed specimens
Gidioot May 19, 2024
3e39277
Moved files from components_old to components
May 20, 2024
2736501
Merge branch 'dev' of github.com:kaldis-berzins/frontscope into dev
May 20, 2024
3c45558
Drag and drop with tiling and windows
May 21, 2024
0831f6c
Fixed a resizing bug and removed resizing when docked
May 21, 2024
69035de
Merged dev into dragndrop
May 22, 2024
95935f9
Added comments
May 22, 2024
f8b3d07
Created UI elements and refactored Paramable
May 23, 2024
90ebea6
This is the branch which fixes the css and html of the specimen windows
May 23, 2024
5f7810e
Added sub-property UI
May 23, 2024
1991550
Fixed name and description properties
May 23, 2024
911c83a
Added resizing and squashed bugs
May 23, 2024
74de5cf
Merge pull request #4 from kaldis-berzins/param-interface
maxd0328 May 23, 2024
efd6584
Merge branch 'param-interface' into 'dev'
May 23, 2024
e042bce
Added icons and updated values of margins/gaps
Gidioot May 23, 2024
aa816f7
Merge branch 'dragndrop' into 'dev'
May 24, 2024
a1c74f5
Merge pull request #5 from kaldis-berzins/dragndrop
maxd0328 May 24, 2024
e3d9d93
Merge individual component of gallery with gallery branch
May 24, 2024
1332b8f
Setup specimen structure
May 24, 2024
70302b3
Moved the drag and drop into scope
May 24, 2024
4869542
Incorporated the specimen class into the specimen editor
May 24, 2024
7fb97bc
Fixed export modules and added docs
May 24, 2024
57d1386
Merge remote-tracking branch 'origin/specimen-setup' into tab-setting…
May 24, 2024
9b227a5
Fixed sequence construction
May 24, 2024
961c386
Doesn't work
May 26, 2024
e9db48a
Fixed visualizer updates
May 26, 2024
f735a21
Improved documentation
May 26, 2024
5111861
Merge branch 'tab-setting-integration' of github.com:kaldis-berzins/f…
May 26, 2024
76b15cf
Fixed error message styling
May 26, 2024
fbffc2c
Merge branch 'tab-setting-integration' of github.com:kaldis-berzins/f…
May 26, 2024
8c01e67
Implemented specimen cards in the gallery
Gidioot May 27, 2024
6ebab99
Temporary fix for canvas resizing
May 27, 2024
993a71a
Merge branch 'tab-setting-integration' of github.com:kaldis-berzins/f…
May 27, 2024
8e70c81
Fixed evil timeout code
May 27, 2024
c6f4f0b
Applied requested PR changes
May 27, 2024
5a5e6f3
Fixed another layout bug
May 27, 2024
045bc1c
Merge branch 'tab-setting-integration' of github.com:kaldis-berzins/f…
May 27, 2024
d92c4e2
Merge pull request #6 from kaldis-berzins/pr-sprint-1-fixes
kaldis-berzins May 27, 2024
ed45a1b
Merge branch 'ui2' into tab_setting_integration
maxd0328 May 28, 2024
5a985da
added comments to the code
ziggybeijer May 28, 2024
17caf8d
Merge branch 'tab-setting-integration' of github.com:kaldis-berzins/f…
ziggybeijer May 28, 2024
1024b7f
Fixed documentation
May 31, 2024
ba24fbd
Merge branch 'tab-setting-integration' of github.com:kaldis-berzins/f…
May 31, 2024
a55fd5e
Merge branch 'tab_setting_integration' into 'dev'
Jun 2, 2024
ae8533c
Re-add the pipeline
Jun 2, 2024
633c2da
Changed name of the change visualizer icon
Jun 2, 2024
835aad7
Merge pull request #7 from kaldis-berzins/tab_setting_integration
kaldis-berzins Jun 2, 2024
53abc0a
Added browser memory methods which save and delete URLs from browser …
Jun 2, 2024
6bd5712
Merge branch 'browser_memory_caching' into 'dev'
Jun 2, 2024
c302388
Merge pull request #8 from kaldis-berzins/browser_memory_caching
kaldis-berzins Jun 2, 2024
40bd598
Made all small changes to PR
Jun 2, 2024
6d4eda1
Additional small changes to PR
Jun 2, 2024
f433a63
Merge branch 'tab_setting_integration' of gitlab.ewi.tudelft.nl:cse20…
Jun 2, 2024
addc0ec
Added minimizing, maximizing, and docking to tabs. Also added missing…
ziggybeijer Jun 2, 2024
55f97f3
fixed minimizing while docking
ziggybeijer Jun 2, 2024
79b5954
Implemented a selection/deselection system for tabs, and reworked the…
ziggybeijer Jun 2, 2024
065ae8a
Implemented functional buttons when docked (minimizing while docking …
ziggybeijer Jun 3, 2024
b13d7bb
Added documentation
ziggybeijer Jun 3, 2024
ef2a77f
added docs
ziggybeijer Jun 4, 2024
343bbc9
add icon compatibility
ziggybeijer Jun 4, 2024
fb6e9bb
Added sequence switcher design for desktop
Gidioot Jun 4, 2024
a8e458d
Implemented changes requested in PR review
Gidioot Jun 4, 2024
05c729d
Merge branch 'dev' into gallery
Gidioot Jun 4, 2024
5aa62a9
Change modal can properly open and close
Gidioot Jun 4, 2024
45202be
Added static types to parameters, and added support for optional para…
Jun 4, 2024
c4c0992
Added comments
Jun 4, 2024
b3a1507
Added functionality to swtich sequences/visualizers
Gidioot Jun 5, 2024
1896196
Circumvented the removal of semicolons at the end of a line
Gidioot Jun 5, 2024
0dbc62a
Added a current slot to memory and implemented a getURLAt function
Jun 5, 2024
f787ba0
Merge branch 'tab_buttons' into 'dev'
Jun 7, 2024
f7f9616
Merge pull request #9 from kaldis-berzins/tab_buttons
kaldis-berzins Jun 7, 2024
99920b4
Finished resizing
kaldis-berzins Jun 7, 2024
2f166cf
Added mobile support for the scope page
ziggybeijer Jun 7, 2024
764ac7b
conquer bugs introduced in last commit with mobile support and added …
ziggybeijer Jun 7, 2024
94a36c9
Trying to prevent annoying merge conflict
ziggybeijer Jun 7, 2024
30742b7
Implemented URL encoding
Jun 8, 2024
e14a8ff
design for the specimen bar
ziggybeijer Jun 8, 2024
5bb38a5
uncommented test
ziggybeijer Jun 8, 2024
29ba387
Reimplemented the memory caching system with new functions and more f…
Jun 8, 2024
cb53564
Fixed checkstyle issues
Jun 8, 2024
a581631
Fixed the few appearing empty pixels between the canvas and the seque…
Gidioot Jun 8, 2024
d670854
Merge branch 'mobile_support' into 'dev'
Gidioot Jun 8, 2024
e3c9d2c
Added functionality to the pause and refresh buttons. Have to wait on…
ziggybeijer Jun 9, 2024
0bcbad6
bug fix
ziggybeijer Jun 9, 2024
6a9cb61
Fixed linting
Jun 9, 2024
c6ee24b
Integrated URLs with website
Jun 10, 2024
e55cc86
Added tests
Jun 10, 2024
2643ed8
Fixed imports for tests
Jun 10, 2024
df14be0
Fixed names and descriptions in export modules
Jun 10, 2024
d8950a6
Merge branch 'ui2' into tab_setting_integration
kaldis-berzins Jun 10, 2024
34f87d3
Fixed linting error
kaldis-berzins Jun 10, 2024
e448ec1
Complete refactoring of the browser caching system
Jun 10, 2024
9606646
added save button, and added icon toggler for pause button
ziggybeijer Jun 12, 2024
0e1f96a
Removed unneccessary icon files
Jun 12, 2024
b4c97c1
added functionality to the share button and made a pop up box to noti…
ziggybeijer Jun 12, 2024
b469419
Merge branch 'gallery' into 'dev'
Jun 12, 2024
2b64b19
Merge branch 'dev' into 'resizing'
Jun 12, 2024
35f8148
Re-added the footer
kaldis-berzins Jun 12, 2024
c2fbf5b
Merge branch 'tab_setting_integration' of github.com:kaldis-berzins/f…
Jun 12, 2024
a04210b
Fixed requested changes
kaldis-berzins Jun 12, 2024
6fbb16b
Type-safe top level properties with DRY
Jun 12, 2024
a7ea5e6
Increased the button size and moved the copy notification to the left…
ziggybeijer Jun 12, 2024
ce02e1a
Merge branch 'resizing' of github.com:kaldis-berzins/frontscope into …
Jun 12, 2024
5b7c830
Fixed aspect ratio request
kaldis-berzins Jun 12, 2024
e4c608d
added mobile support
ziggybeijer Jun 12, 2024
2f6101b
Merged tab_setting_integration into urls
Jun 12, 2024
f7652e2
Merge branch 'urls' into specimen_storage_redevelopment
Jun 12, 2024
db8ead6
mobile
ziggybeijer Jun 12, 2024
9efc729
more changes for mobile support
ziggybeijer Jun 12, 2024
99e0db0
Merge remote-tracking branch 'origin/specimen_storage_redevelopment' …
ziggybeijer Jun 12, 2024
990a96e
Merging resizing into thumbnails
Jun 12, 2024
c8da670
added functionality to save button and renamed method in browserCachi…
ziggybeijer Jun 12, 2024
182d7e5
added overwrite functionality to the save button
ziggybeijer Jun 12, 2024
4f1942a
Fixed checkstyle problems
Jun 12, 2024
fa177be
Fixed checkstyle changes 2
Jun 12, 2024
3470749
clickpropagation issue fixed!
ziggybeijer Jun 12, 2024
1593f63
Merge pull request #10 from kaldis-berzins/memory_and_resizing
maxd0328 Jun 12, 2024
708be6f
Resolved merge conflict and added functionality to the input box in t…
ziggybeijer Jun 13, 2024
1d7da68
working on fixing mobile
ziggybeijer Jun 13, 2024
1c16b0a
final mobile fixes
ziggybeijer Jun 13, 2024
8e23b1a
removed console.log statements
ziggybeijer Jun 13, 2024
27d2ce2
consistent use of Navbar also in gallery
ziggybeijer Jun 16, 2024
cdf80d4
Added ability to open specimens and removed placeholder gallery speci…
Jun 16, 2024
d73e5f8
Merge branch 'specimen_bar' into open_specimens
Jun 16, 2024
098e81b
Fixed problems with reading URLs
Jun 16, 2024
54c02da
Merged dev
kaldis-berzins Jun 16, 2024
195609c
Removed unused files
kaldis-berzins Jun 17, 2024
429f599
Merge remote-tracking branch 'origin/specimen_bar' into sequence-visu…
kaldis-berzins Jun 17, 2024
db26321
Added opening and deleting of saved and featured specimens
Jun 17, 2024
0ba6379
Removed unneccessary comment
Jun 17, 2024
5e333e1
Added ability to minimise gallery sections
Jun 17, 2024
67ef6ad
download button functionality
ziggybeijer Jun 17, 2024
47acad0
Added mobile
kaldis-berzins Jun 17, 2024
bab1203
Fix empty status bug
kaldis-berzins Jun 17, 2024
3d6e5a3
Implemented thumbnail parameter handling
Jun 17, 2024
8181f39
Merged open_specimens
kaldis-berzins Jun 17, 2024
c9024db
Merge remote-tracking branch 'origin/download_button' into confluence
kaldis-berzins Jun 17, 2024
f8484d2
Fixed some small stuff
kaldis-berzins Jun 17, 2024
557f527
Fixed some visual bugs
kaldis-berzins Jun 20, 2024
2da1603
Final PR fixes
Jun 20, 2024
07cacb0
Added e2e testing
kaldis-berzins Jun 21, 2024
25d6986
Fixed configuration
kaldis-berzins Jun 21, 2024
fe6cd34
Added extra end to end tests and added these tests to the pipeline
ziggybeijer Jun 21, 2024
2637c2c
removed flaky test
ziggybeijer Jun 21, 2024
0a7f4d4
finally removed flakiness (caused by running tests in parallel)
ziggybeijer Jun 21, 2024
b300c45
new tests
ziggybeijer Jun 21, 2024
9cf77cd
added tests for scope and gallery
ziggybeijer Jun 21, 2024
8a75bf3
Added more tests for the gallery
ziggybeijer Jun 21, 2024
b0609f6
Last PR changes
Jun 24, 2024
8558c52
fixed pipeline
ziggybeijer Jun 24, 2024
268dc1b
pipeline
ziggybeijer Jun 24, 2024
682d52f
Bug fixes for #342
Jun 26, 2024
76892db
Merge conflict resolution
Jun 26, 2024
e76a681
Merge conflict resolution with tab setting integration
Jun 26, 2024
f8c64d1
Small testing fix for absolute imports
Jun 26, 2024
3758b20
Merge branch 'specimen_storage_redevelopment' of gitlab.ewi.tudelft.n…
Jun 26, 2024
8e8b14c
Merge branch 'memory_and_resizing' of gitlab.ewi.tudelft.nl:cse2000-s…
Jun 26, 2024
0c7d753
Remove gitlab-ci.yml
Jun 26, 2024
093cf5b
Resolve conflicts with specimen bar
Jun 26, 2024
6a0a02f
Removed gitlab-ci.yml
Jun 26, 2024
5731ea6
Removed useless changes
Jun 26, 2024
ee5f5ad
Merge changes into gallery_integration
Jun 26, 2024
0b37321
Thumbnail fixes
Jun 26, 2024
d1d2e62
Merge changes to visualizer/sequence switcher
Jun 26, 2024
aba742d
Switcher bugfix
Jun 26, 2024
9860ffb
Removed OEIS
Jun 26, 2024
f24ae1d
Merge branch 'urls' into specimen_browser_storage
Jun 26, 2024
7f8bf90
Merge branch 'specimen_browser_storage' into resizing_and_url_integra…
Jun 26, 2024
f8bdc34
Merge branch 'resizing_and_url_integration' into specimen_bar
Jun 26, 2024
3c1cd5a
Merge branch 'specimen_bar' into gallery_integration
Jun 26, 2024
bb9bd8c
Merge branch 'gallery_integration' into sequence_visualizer_switcher
Jun 26, 2024
8233768
Fixed param editor
Jun 26, 2024
a548339
Deleted useless file
Jun 26, 2024
907f265
Merging bug fixes
Jun 26, 2024
ad129fb
Fixed footer placement
Jun 26, 2024
c78971b
Resolve testing merge conflicts
Jun 26, 2024
5d9930d
Remove useless assets
Jun 26, 2024
0794c99
Merge branch 'sequence_visualizer_switcher' into final_fixes
Jun 26, 2024
7233673
Merge branch 'final_fixes' into end_to_end_testing
Jun 26, 2024
ac52e86
Merge remote-tracking branch 'frontscope/ui2' into urls
kaldis-berzins Jun 26, 2024
2f0ac2a
Merge branch 'urls' into specimen_browser_storage
kaldis-berzins Jun 26, 2024
f1b3471
Merge branch 'specimen_browser_storage' into resizing_and_url_integra…
kaldis-berzins Jun 26, 2024
2cd06fe
Merge branch 'resizing_and_url_integration' into specimen_bar
kaldis-berzins Jun 26, 2024
6ce383d
Merge branch 'specimen_bar' into gallery_integration
kaldis-berzins Jun 26, 2024
7788ce6
Merge branch 'gallery_integration' into sequence_visualizer_switcher
kaldis-berzins Jun 26, 2024
17997e7
Fixed URL updating
Jun 26, 2024
cfe969a
Merge branch 'sequence_visualizer_switcher' of github.com:kaldis-berz…
Jun 26, 2024
1d24d2e
Merge branch 'sequence_visualizer_switcher' into final_fixes
Jun 26, 2024
cff2f32
OEIS support (almost)
Jun 26, 2024
f5392cb
Removed useless css
kaldis-berzins Jun 26, 2024
f2b8797
Merge branch 'specimen_bar' into gallery_integration
kaldis-berzins Jun 26, 2024
5d5ecc9
Removed useless css
kaldis-berzins Jun 26, 2024
943c3d7
Merge branch 'sequence_visualizer_switcher' of github.com:kaldis-berz…
kaldis-berzins Jun 26, 2024
90afcad
Some final fixes
Jun 26, 2024
c4029d8
Merge branch 'sequence_visualizer_switcher' into final_fixes
Jun 26, 2024
dd016a4
Removed extraneous console.log
Jun 27, 2024
b48a0b3
Merge branch 'final_fixes' into end_to_end_testing
Jun 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ site

# Emacs backup files
*~
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
61 changes: 61 additions & 0 deletions e2e/gallery.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import {test, expect} from '@playwright/test'

test.beforeEach(async ({page}) => {
await page.goto('/gallery', {waitUntil: 'domcontentloaded'})
await page.evaluate(() => localStorage.clear())
})

test.describe('Scope', () => {
test('Has a title', async ({page}) => {
await expect(page).toHaveTitle(/Numberscope/)
})
test('minimizing', async ({page}) => {
await expect(page.locator('#featured-arrow')).toHaveClass(/arrow-up/)
await expect(page.locator('#featured-arrow')).not.toHaveClass(
/arrow-down/
)

await page.locator('#featured-arrow').first().click()
await expect(page.locator('#featured-arrow')).not.toHaveClass(
/arrow-up/
)
await expect(page.locator('#featured-arrow')).toHaveClass(
/arrow-down/
)

await page.locator('#featured-arrow').first().click()
await expect(page.locator('#featured-arrow')).toHaveClass(/arrow-up/)
await expect(page.locator('#featured-arrow')).not.toHaveClass(
/arrow-down/
)
})
test('clicking on a featured item', async ({page}) => {
await page.locator('.card-body >> nth=1').click()
await expect(page.url()).not.toContain('gallery')
await expect(
await page.locator('#sequenceTab .subheading').innerText()
).toMatch('Random integers 12 to 12')
await expect(
await page.locator('#visualiserTab .subheading').innerText()
).toMatch('Mod Fill')
})
test('saving a specimen and then deleting it', async ({page}) => {
await page.goto('/', {waitUntil: 'domcontentloaded'})
await page.locator('#specimen-bar-desktop #save-button').click()
await page.goto('/gallery', {waitUntil: 'domcontentloaded'})

const savedCard = await page
.locator('#saved-gallery .card-body')
.first()

await expect(
await savedCard.locator('.card-title').innerText()
).toMatch('Specimen')
await expect(
await savedCard.locator('.card-text').innerText()
).toMatch('Random Integers in Range')

await savedCard.locator('.delete-button').click()
await expect(page.locator('#saved-specimens >> *')).toHaveCount(0)
})
})
158 changes: 158 additions & 0 deletions e2e/scope.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
import {test, expect} from '@playwright/test'

test.beforeEach(async ({page}) => {
await page.goto('/', {waitUntil: 'domcontentloaded'})
await page.evaluate(() => localStorage.clear())
})

test.describe('Scope', () => {
test('Has a title', async ({page}) => {
await expect(page).toHaveTitle(/Numberscope/)
})

test('Tabs are draggable', async ({page}) => {
await page
.locator('#visualiserTab .buttons')
.dragTo(page.locator('#canvas-container'), {
sourcePosition: {
x: 10,
y: 10,
},
targetPosition: {
x: 100,
y: 100,
},
})
await expect(page.locator('#bottom-right-dropzone')).toHaveClass(
/empty/
)
})

test('Sidebars disappear when tabs are dragged', async ({page}) => {
await page
.locator('#visualiserTab .buttons')
.dragTo(page.locator('#canvas-container'), {
sourcePosition: {
x: 10,
y: 10,
},
})

await page
.locator('#sequenceTab .buttons')
.dragTo(page.locator('#canvas-container'), {
sourcePosition: {
x: 10,
y: 10,
},

targetPosition: {
x: 500,
y: 100,
},
})

await expect(page.locator('#right-dropzone-container')).toHaveClass(
/empty/
)
await expect(
page.locator('#right-dropzone-container .dropzone-resize')
).toHaveCSS('display', 'none')

await expect(page.locator('#left-dropzone-container')).toHaveClass(
/empty/
)
await expect(
page.locator('#left-dropzone-container .dropzone-resize')
).toHaveCSS('display', 'none')
})

test('Changing a sequence', async ({page}) => {
await page.locator('#sequenceTab .change-button').click()
await page.locator('#results .sequence').first().click()
await expect(
await page.locator('#sequenceTab .subheading').innerText()
).toMatch('Constant Sequence')
})
test('minimizing a tab', async ({page}) => {
await page.locator('#visualiserTab .minimize').click()
await expect(page.locator('#visualiserTab')).toHaveClass(/minimized/)
await expect(
await page.locator('#visualiserTab').evaluate(element => {
return element.clientHeight
})
).toBeLessThan(125)

await page.locator('#visualiserTab .minimize').click()
await expect(page.locator('#visualiserTab')).not.toHaveClass(
/minimized/
)
await expect(
await page.locator('#visualiserTab').evaluate(element => {
return element.clientHeight
})
).toBeGreaterThan(375)
})
test('Changing a parameter', async ({page}) => {
const oldURL = page.url()

await page.locator('#modDimension').fill('100')
await expect(page.locator('#modDimension')).toHaveValue('100')

await expect(page.url()).not.toEqual(oldURL)
})
test('changing the specimen name', async ({page}) => {
const oldURL = page.url()

await page.locator('#specimen-bar-desktop input').fill('test')
const currentSpecimenIM = await page.evaluate(() => {
return localStorage.getItem('currentSpecimen')
})
if (currentSpecimenIM === null) {
throw new Error('currentSpecimen is null')
}
const currentSpecimen = JSON.parse(currentSpecimenIM)

await expect(currentSpecimen.name).toEqual('test')
await expect(page.url()).not.toEqual(oldURL)
})
test('refreshing the specimen', async ({page}) => {
const oldCanvas = await page.locator('#canvas-container canvas')

oldCanvas.evaluate(canvas => {
canvas.classList.add('old-canvas')
})
await page.locator('#specimen-bar-desktop #refresh-button').click()

const newCanvas = await page.locator('#canvas-container canvas')
await expect(newCanvas).not.toBe(oldCanvas)
await expect(newCanvas).not.toHaveClass('old-canvas')
})

test('copying to clipboard', async ({page, context, browserName}) => {
// grant clipboard permissions for chromium, other browsers don't
// allow this due to privacy concerns
if (browserName === 'chromium') {
await context.grantPermissions([
'clipboard-read',
'clipboard-write',
])
}

await page.locator('#specimen-bar-desktop #share-button').click()

let clipboardContent
if (browserName === 'chromium') {
const handle = await page.evaluateHandle(() =>
navigator.clipboard.readText()
)
clipboardContent = await handle.jsonValue()
} else {
// we can't read the clipboard content in other browsers
clipboardContent = page.url()
}

const url = page.url()
await expect(clipboardContent).toMatch(url)
})
})
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

<!-- Material design icons. Use the .material-icons-sharp class to turn text into an icon -->
<link href="https://fonts.googleapis.com/css2?family=Material+Icons+Sharp" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp" rel="stylesheet">

</head>
<body>
<noscript>
Expand Down
Loading
Loading