@@ -2,27 +2,22 @@ import Home_PO from "../support/pageObjects/Home_PO";
2
2
import Search_PO from "../support/pageObjects/Search_PO" ;
3
3
import 'cypress-axe'
4
4
5
- describe ( 'Judge.Me Site' , ( ) => {
5
+ describe ( 'Judge.Me Site E2E Test ' , ( ) => {
6
6
7
7
const baseUrl = 'https://judge.me/reviews' ;
8
+ const home_po = new Home_PO ( ) ;
8
9
const search_po = new Search_PO ( ) ;
9
10
10
11
beforeEach ( ( ) => {
11
- // visit the judge.me site before each test
12
12
cy . visit ( baseUrl ) ;
13
13
cy . injectAxe ( ) ;
14
14
} ) ;
15
15
16
16
// Verify Page Load
17
17
it ( 'should load the page successfully and display key elements' , ( ) => {
18
- const home_po = new Home_PO ( ) ;
19
18
home_po . verifyPageLoad ( baseUrl )
20
19
} ) ;
21
20
22
- it ( 'should have no accessibility violations' , ( ) => {
23
- cy . checkA11y ( ) ;
24
- } ) ;
25
-
26
21
// Validate Search Functionality
27
22
it ( 'should display correct results when searching by keyword' , ( ) => {
28
23
search_po . verifySearchFunctionality ( ) ;
@@ -48,17 +43,11 @@ describe('Judge.Me Site', () => {
48
43
search_po . validateCurrencyFilter ( )
49
44
} )
50
45
46
+ it ( 'should have no accessibility violations' , ( ) => {
47
+ cy . checkA11y ( ) ;
48
+ } ) ;
49
+
51
50
it ( 'should run lighthouse performance audit' , ( ) => {
52
- const thresholds = {
53
- performance : 50 ,
54
- accessibility : 80 ,
55
- seo : 60 ,
56
- pwa : 50 ,
57
- } ;
58
- const lighthouseConfig = {
59
- formFactor : 'desktop' ,
60
- screenEmulation : { disabled : true } ,
61
- } ;
62
- cy . lighthouse ( thresholds , lighthouseConfig ) ;
51
+ home_po . verifyLighthousePerformance ( )
63
52
} ) ;
64
53
} ) ;
0 commit comments