|
8 | 8 | appName: Constants.commonConstantsData.home, |
9 | 9 | host: 3001 |
10 | 10 | }, |
11 | | - // TODO : Checks for Shop app (port 3002) are commented, because there is the error after reloading shop page (localhost:3002/shop). |
12 | | - // Error: Hydration failed because the initial UI does not match what was rendered on the server. |
13 | | - // Uncomment after fixing |
14 | | - // { |
15 | | - // appName: Constants.elementsText.nextjsSsrShop, |
16 | | - // host: 3002 |
17 | | - // }, |
| 11 | + { |
| 12 | + appName: Constants.elementsText.nextJsSsrApp.shop, |
| 13 | + host: 3002 |
| 14 | + }, |
18 | 15 | { |
19 | 16 | appName: Constants.elementsText.nextJsSsrApp.checkout, |
20 | 17 | host: 3000 |
|
27 | 24 | appName: string |
28 | 25 | host: number |
29 | 26 | }) => { |
30 | | - // TODO : Uncomment after fixing the Error: Hydration failed |
31 | | - // let appName = property.host === 3001 ? appsData[0].appName : property.host === 3002 ? appsData[1].appName : appsData[2].appName; |
32 | | - // let host = property.host === 3001 ? appsData[0].host : property.host === 3002 ? appsData[1].host : appsData[2].host; |
33 | | - const appName = property.host === 3001 ? appsData[0].appName : appsData[1].appName; |
34 | | - const host = property.host === 3001 ? appsData[0].host : appsData[1].host; |
35 | 27 |
|
36 | 28 | const navigationTextedLinks = [ |
37 | 29 | { |
|
82 | 74 | }, |
83 | 75 | ] |
84 | 76 |
|
85 | | - describe(`Check content in ${appName} app`, () => { |
86 | | - // TODO cy.exec don't build the apps correctly cause lerna executes without exit code. Uncomment after fix this issue! |
87 | | - // before(() => { |
88 | | - // basePage.buildTheSample(Constants.samplesPath.nextjsSsr) |
89 | | - // }) |
90 | | - |
91 | | - // after(() => { |
92 | | - // basePage.shutdownTheSample(Constants.samplesPath.nextjsSsr) |
93 | | - // }) |
94 | | - |
95 | | - |
96 | | - |
97 | | - describe(`Check the content of Home page`, () => { |
| 77 | + describe(`Check content in ${property.appName} app`, () => { |
98 | 78 | beforeEach(() => { |
99 | | - basePage.openLocalhost(host) |
| 79 | + basePage.openLocalhost(property.host) |
100 | 80 | }) |
101 | 81 |
|
102 | 82 | it(`Check the header content of Home page`, () => { |
|
180 | 160 |
|
181 | 161 | describe(`Check links on Home page`, () => { |
182 | 162 | beforeEach(() => { |
183 | | - basePage.openLocalhost(host) |
| 163 | + basePage.openLocalhost(property.host) |
184 | 164 | }) |
185 | 165 |
|
186 | 166 | navigationTextedLinks.forEach((property: { text: string, link: string }) => { |
|
208 | 188 | basePage.checkElementContainText({ |
209 | 189 | selector: baseSelectors.tags.coreElements.link, |
210 | 190 | text: property.text, |
211 | | - link: property.link, |
212 | | - isParent: true |
| 191 | + link: property.link |
213 | 192 | }) |
214 | 193 | }) |
215 | 194 | }); |
|
228 | 207 |
|
229 | 208 | describe(`Check the content of Shop page`, () => { |
230 | 209 | beforeEach(() => { |
231 | | - basePage.openLocalhost(host, Constants.hrefs.nextJsSsrApp.shop) |
| 210 | + basePage.openLocalhost(property.host, Constants.hrefs.nextJsSsrApp.shop) |
232 | 211 | }) |
233 | 212 |
|
234 | 213 | it(`Check the header content of Shop page`, () => { |
|
271 | 250 |
|
272 | 251 | describe(`Check links on Shop page`, () => { |
273 | 252 | beforeEach(() => { |
274 | | - basePage.openLocalhost(host, Constants.hrefs.nextJsSsrApp.shop) |
| 253 | + basePage.openLocalhost(property.host, Constants.hrefs.nextJsSsrApp.shop) |
275 | 254 | }) |
276 | 255 |
|
277 | 256 | navigationTextedLinks.forEach((property: { text: string, link: string }) => { |
|
308 | 287 |
|
309 | 288 | describe(`Check the content of Checkout page`, () => { |
310 | 289 | beforeEach(() => { |
311 | | - basePage.openLocalhost(host, Constants.hrefs.nextJsSsrApp.checkout) |
| 290 | + basePage.openLocalhost(property.host, Constants.hrefs.nextJsSsrApp.checkout) |
312 | 291 | }) |
313 | 292 |
|
314 | 293 |
|
|
362 | 341 | index: 1 |
363 | 342 | }) |
364 | 343 | }) |
365 | | - |
| 344 | + |
366 | 345 | describe(`Check links on Checkout page`, () => { |
367 | | - beforeEach(() => { |
368 | | - basePage.openLocalhost(host, Constants.hrefs.nextJsSsrApp.checkout) |
369 | | - }) |
| 346 | + beforeEach(() => { |
| 347 | + basePage.openLocalhost(property.host, Constants.hrefs.nextJsSsrApp.checkout) |
| 348 | + }) |
370 | 349 |
|
371 | | - navigationTextedLinks.forEach((property: { text: string, link: string }) => { |
372 | | - it(`Check that ${property.text} text includes link and is not disabled`, () => { |
373 | | - basePage.checkElementContainText({ |
374 | | - selector: baseSelectors.tags.coreElements.link, |
375 | | - text: property.text, |
376 | | - link: property.link, |
| 350 | + navigationTextedLinks.forEach((property: { text: string, link: string }) => { |
| 351 | + it(`Check that ${property.text} text includes link and is not disabled`, () => { |
| 352 | + basePage.checkElementContainText({ |
| 353 | + selector: baseSelectors.tags.coreElements.link, |
| 354 | + text: property.text, |
| 355 | + link: property.link, |
| 356 | + }) |
377 | 357 | }) |
378 | 358 | }) |
379 | | - }) |
380 | 359 |
|
381 | | - commonTextedLinks.forEach((property: { text: string, link: string }) => { |
382 | | - it(`Check that ${property.text} text includes link and is not disabled`, () => { |
383 | | - basePage.checkElementContainText({ |
384 | | - selector: baseSelectors.tags.coreElements.link, |
385 | | - text: property.text, |
386 | | - link: property.link, |
| 360 | + commonTextedLinks.forEach((property: { text: string, link: string }) => { |
| 361 | + it(`Check that ${property.text} text includes link and is not disabled`, () => { |
| 362 | + basePage.checkElementContainText({ |
| 363 | + selector: baseSelectors.tags.coreElements.link, |
| 364 | + text: property.text, |
| 365 | + link: property.link, |
| 366 | + }) |
387 | 367 | }) |
388 | 368 | }) |
389 | | - }) |
390 | 369 |
|
391 | | - navigationTextedLinks.forEach((property: { text: string, url: string }) => { |
392 | | - it(`Check that ${property.text} text navigation link works`, () => { |
393 | | - basePage.clickElementWithText({ |
394 | | - selector: baseSelectors.tags.coreElements.link, |
395 | | - text: property.text}) |
| 370 | + navigationTextedLinks.forEach((property: { text: string, url: string }) => { |
| 371 | + it(`Check that ${property.text} text navigation link works`, () => { |
| 372 | + basePage.clickElementWithText({ |
| 373 | + selector: baseSelectors.tags.coreElements.link, |
| 374 | + text: property.text}) |
396 | 375 |
|
397 | | - cy.wait(500) |
398 | | - basePage.checkUrlText(property.url, true) |
| 376 | + cy.wait(500) |
| 377 | + basePage.checkUrlText(property.url, true) |
| 378 | + }) |
399 | 379 | }) |
400 | 380 | }) |
401 | 381 | }) |
402 | | - }) |
403 | | - }) |
404 | 382 | }) |
0 commit comments