Skip to content

Commit 805bc8e

Browse files
committed
proper cypress convertion from puppeteer
1 parent 8b882ad commit 805bc8e

11 files changed

Lines changed: 443 additions & 298 deletions

File tree

‎frontend/src/feature/quote/dialog/delete.dialog.tsx‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default function DeleteQuoteDialog(props: Props) {
2929

3030
return (
3131
<Dialog open={open} onOpenChange={setOpen}>
32-
<form onSubmit={handleFormSubmit}>
32+
<form onSubmit={handleFormSubmit} aria-label="delete-note-form">
3333
{/* <DialogTrigger asChild>
3434
<Button variant="outline">Add Quote</Button>
3535
</DialogTrigger> */}
@@ -49,7 +49,12 @@ export default function DeleteQuoteDialog(props: Props) {
4949
{/* <DialogClose asChild>
5050
<Button variant="outline">Close</Button>
5151
</DialogClose> */}
52-
<Button type="submit" onClick={handleFormSubmit} variant={'destructive'} className="">
52+
<Button
53+
type="submit"
54+
onClick={handleFormSubmit}
55+
aria-label="delete-note"
56+
variant={'destructive'}
57+
className="">
5358
Delete Quote
5459
</Button>
5560
</DialogFooter>

‎frontend/src/feature/quote/list.tags.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export function ListTags(props: Props) {
1919
<div className="flex flex-wrap gap-2">
2020
{tags.map((tag) => (
2121
<Badge
22+
2223
variant={'outline'}
2324
className=" bg-primary/10 border-primary/20 text-primary/70"
2425
key={tag.id}

‎frontend/src/feature/quote/popover/filter.popover.tsx‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ export function TagFilter({ tags, value, onChange }: TagFilterProps) {
2727
}
2828

2929
return (
30-
<Popover open={open} onOpenChange={setOpen}>
31-
<PopoverTrigger asChild >
30+
<Popover open={open} onOpenChange={setOpen}>
31+
<PopoverTrigger asChild aria-label="open-filter">
3232
<Button variant="outline" className={
3333
cn(
3434
"gap-2 relative",
@@ -48,7 +48,7 @@ export function TagFilter({ tags, value, onChange }: TagFilterProps) {
4848
</Button>
4949
</PopoverTrigger>
5050

51-
<PopoverContent className="w-40">
51+
<PopoverContent className="w-40" aria-label={'filter-by'}>
5252
<div className="sticky top-0 z-10 backdrop-blur-sm">
5353
<div className=" ">Filter by tags</div>
5454
<Separator className="bg-border" />
@@ -58,6 +58,7 @@ export function TagFilter({ tags, value, onChange }: TagFilterProps) {
5858
{tags.map(tag => (
5959
<Button
6060
key={tag}
61+
aria-label={'filter-by-'+tag}
6162
size="sm"
6263
variant={value.includes(tag) ? "default" : "outline"}
6364
onClick={() => toggleTag(tag)}

‎frontend/src/page/quote/quote-list/quote-list.page.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ export function QuoteListPage() {
105105
<div className=" flex flex-col">
106106
{/* Sticky Header */}
107107
<div
108+
aria-label='sticky-header'
108109
className="gap-2 p-2 flex flex-col sticky top-0 z-20 bg-background rounded-b"
109110
>
110111
<div className="flex justify-between">
@@ -121,11 +122,12 @@ export function QuoteListPage() {
121122
<InputGroup>
122123
<InputGroupInput
123124
placeholder="Search..."
125+
aria-label='search-note'
124126
value={search}
125127
onChange={e => setSearch(e.target.value)}
126128
/>
127129
<InputGroupAddon>
128-
<SearchIcon />
130+
<SearchIcon aria-label='search-icon'/>
129131
</InputGroupAddon>
130132
</InputGroup>
131133

‎frontend/src/page/quote/quote/quote.page.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,10 @@ export function QuotePage(props: Props) {
192192
>
193193

194194
<div className='flex p-4 bg-background flex-row sticky top-0 z-10 justify-between items-center'>
195-
<Link to="/" className='flex items-center gap-2'>
195+
<Link to="/"
196+
aria-label="link-to-home"
197+
className='flex items-center gap-2'
198+
>
196199
<Button variant="outline" size="icon">
197200
<ArrowLeftIcon />
198201
</Button>

‎pnpm-lock.yaml‎

Lines changed: 78 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1-
describe('template spec', () => {
2-
it('passes', () => {
3-
cy.visit('https://example.cypress.io')
1+
2+
describe('Converted Puppeteer Test', () => {
3+
it('runs converted steps', () => {
4+
Cypress.config('defaultCommandTimeout', 5000)
5+
cy.viewport(802, 633)
6+
cy.visit("http://localhost:5173/")
7+
cy.get("nav button").click(41, 26)
8+
cy.get("div.flex-col > div.grid > div > div > div > div:nth-of-type(1) > div").click(232.875, 76)
9+
cy.get("div.flex-col > div.grid > div > div > div > div:nth-of-type(1) > div").type("cypress test")
10+
cy.get("html").click(666, 333)
11+
cy.get("body > div:nth-of-type(2) div:nth-of-type(6)").click(83, 25)
12+
cy.get("a > button").click(10.875, 24)
413
})
5-
})
14+
})

0 commit comments

Comments
 (0)