@@ -9,12 +9,10 @@ import {
99 REGISTER_DREP_DOC_URL ,
1010 TERMS_AND_CONDITIONS ,
1111} from "@constants/docsUrl" ;
12- import { faker } from "@faker-js/faker" ;
1312import { test } from "@fixtures/walletExtension" ;
1413import { setAllureEpic } from "@helpers/allure" ;
1514import { isMobile , openDrawer } from "@helpers/mobile" ;
1615import { expect , Page } from "@playwright/test" ;
17- import { randomUUID } from "crypto" ;
1816import environments from "lib/constants/environments" ;
1917
2018test . beforeEach ( async ( ) => {
@@ -104,165 +102,7 @@ test("6M. Should navigate between footer links", async ({ page, context }) => {
104102 await expect ( helpUrl ) . toHaveURL ( HELP_DOC_URL ) ;
105103} ) ;
106104
107- test . describe ( "User Snap" , ( ) => {
108- test . beforeEach ( async ( { page } ) => {
109- await page . goto ( "/" ) ;
110- await page . waitForTimeout ( 2_000 ) ; // wait until page load properly
111-
112- await page . getByTestId ( "feedback-footer-button" ) . click ( ) ;
113- } ) ;
114-
115- test ( "6N. Should open feedback modal" , async ( { page } ) => {
116- await expect ( page . getByLabel ( "Usersnap widget" ) ) . toBeVisible ( ) ;
117- await expect (
118- page . getByRole ( "button" , {
119- name : "Report an issue Something" ,
120- } )
121- ) . toBeVisible ( ) ;
122- await expect (
123- page . getByRole ( "button" , {
124- name : "Idea or new feature Let us" ,
125- } )
126- ) . toBeVisible ( ) ;
127- } ) ;
128-
129- test ( "6O. Should verify a bug report form" , async ( { page } ) => {
130- await page
131- . getByRole ( "button" , {
132- name : "Report an issue Something" ,
133- } )
134- . click ( ) ;
135-
136- await expect (
137- page . getByRole ( "heading" , { name : "Report a bug" } )
138- ) . toBeVisible ( ) ;
139- await expect ( page . getByPlaceholder ( "Your feedback" ) ) . toBeVisible ( ) ;
140- await expect ( page . getByText ( "Drag & drop or Browse" ) ) . toBeVisible ( ) ;
141- await expect ( page . getByLabel ( "Take screenshot" ) ) . toBeVisible ( ) ;
142- await expect ( page . getByLabel ( "Record" ) ) . toBeVisible ( ) ;
143- await expect ( page . getByRole ( "button" , { name : "Submit" } ) ) . toBeVisible ( ) ;
144- } ) ;
145-
146- test ( "6P. Should verify feature form" , async ( { page } ) => {
147- await page
148- . getByRole ( "button" , {
149- name : "Idea or new feature Let us" ,
150- } )
151- . click ( ) ;
152-
153- await expect (
154- page . getByRole ( "heading" , { name : "Idea or new feature" } )
155- ) . toBeVisible ( ) ;
156- await expect (
157- page . getByPlaceholder ( "Example: New navigation" )
158- ) . toBeVisible ( ) ;
159- await expect (
160- page . getByPlaceholder ( "Example: New navigation" )
161- ) . toBeVisible ( ) ;
162- await expect ( page . getByLabel ( "Any additional details" ) ) . toBeVisible ( ) ;
163- await expect ( page . getByText ( "Drag & drop or Browse" ) ) . toBeVisible ( ) ;
164- await expect (
165- page . getByLabel ( "Please summarize your idea or" )
166- ) . toBeVisible ( ) ;
167- await expect ( page . getByLabel ( "Take screenshot" ) ) . toBeVisible ( ) ;
168- await expect ( page . getByLabel ( "Record" ) ) . toBeVisible ( ) ;
169- await expect ( page . getByRole ( "button" , { name : "Submit" } ) ) . toBeVisible ( ) ;
170- } ) ;
171-
172- test . describe ( "Feedback Tests" , ( ) => {
173- const attachmentInputSelector = "input[type=file]" ;
174- const feedbackApiUrl =
175- "https://widget.usersnap.com/api/widget/xhrrpc?submit_feedback" ;
176- const bucketUrl =
177- "https://s3.eu-central-1.amazonaws.com/upload.usersnap.com" ;
178- const mockAttachmentPath = "./lib/_mock/mockAttachment.png" ;
179-
180- const interceptBucket = async ( page : Page ) => {
181- await page . route ( bucketUrl , async ( route ) =>
182- route . fulfill ( {
183- status : 204 ,
184- } )
185- ) ;
186- } ;
187-
188- const interceptUsersnap = async ( page : Page ) => {
189- await page . route ( feedbackApiUrl , async ( route ) =>
190- route . fulfill ( {
191- status : 200 ,
192- body : JSON . stringify ( {
193- status : true ,
194- data : {
195- feedback : {
196- feedback_id : randomUUID ( ) ,
197- assignee_id : randomUUID ( ) ,
198- labels : [ ] ,
199- } ,
200- screen_recording_url : null ,
201- attachment_urls : [
202- {
203- url : bucketUrl ,
204- fields : {
205- "Content-Type" : "image/png" ,
206- key : randomUUID ( ) ,
207- } ,
208- } ,
209- ] ,
210- } ,
211- } ) ,
212- } )
213- ) ;
214- } ;
215-
216- test ( "6Q. Should report an issue" , async ( { page } ) => {
217- // Intercept Usersnap submit API
218- await interceptUsersnap ( page ) ;
219- await interceptBucket ( page ) ;
220- await page
221- . getByRole ( "button" , {
222- name : "Report an issue Something" ,
223- } )
224- . click ( ) ;
225-
226- await page
227- . getByPlaceholder ( "Your feedback" )
228- . fill ( faker . lorem . paragraph ( 2 ) ) ;
229- await page . setInputFiles ( attachmentInputSelector , [ mockAttachmentPath ] ) ;
230-
231- await page . getByRole ( "button" , { name : "Submit" } ) . click ( ) ;
232-
233- await expect ( page . getByText ( "Thank you!" ) ) . toBeVisible ( ) ;
234- } ) ;
235-
236- test ( "6R. Should submit an idea or new feature" , async ( { page } ) => {
237- // Intercept Usersnap submit API
238- await interceptUsersnap ( page ) ;
239- await interceptBucket ( page ) ;
240-
241- await page
242- . getByRole ( "button" , {
243- name : "Idea or new feature Let us" ,
244- } )
245- . click ( ) ;
246-
247- await page
248- . getByPlaceholder ( "Example: New navigation" )
249- . fill ( faker . lorem . words ( 4 ) ) ;
250- await page
251- . getByLabel ( "Please summarize your idea or" )
252- . fill ( faker . lorem . paragraph ( 2 ) ) ;
253- await page
254- . getByLabel ( "Any additional details" )
255- . fill ( faker . lorem . paragraph ( 2 ) ) ;
256- await page . setInputFiles ( attachmentInputSelector , [ mockAttachmentPath ] ) ;
257-
258- await page . getByRole ( "button" , { name : "Submit" } ) . click ( ) ;
259-
260- await expect ( page . getByText ( "Thank you!" ) ) . toBeVisible ( ) ;
261- } ) ;
262- } ) ;
263- } ) ;
264-
265- test ( "6S. Should Warn users that they are in bootstrapping phase via banner" , async ( {
105+ test ( "6N. Should Warn users that they are in bootstrapping phase via banner" , async ( {
266106 page,
267107 context,
268108} ) => {
@@ -296,7 +136,7 @@ test("6S. Should Warn users that they are in bootstrapping phase via banner", as
296136 await expect ( bootstrap ) . toHaveURL ( BOOTSTRAP_DOC_URL ) ;
297137} ) ;
298138
299- test ( "6T . Should display proper network name" , async ( { page } ) => {
139+ test ( "6O . Should display proper network name" , async ( { page } ) => {
300140 await page . route ( "**/network/metrics" , async ( route ) => {
301141 // Fetch the original response from the server
302142 const response = await route . fetch ( ) ;
0 commit comments