victorious-honey-34966
09/12/2022, 5:04 PMlittle-address-70980
09/12/2022, 6:11 PMstale-optician-85950
09/12/2022, 7:27 PMcy.request()
command https://docs.cypress.io/api/commands/request
Also @gray-kilobyte-89541 has a video on the topic eager-london-10753
09/12/2022, 7:27 PMgray-kilobyte-89541
09/12/2022, 7:32 PMlimited-barista-33480
09/12/2022, 11:04 PMgreat-beard-98693
09/13/2022, 8:05 AMhandsome-lion-1748
09/13/2022, 8:39 AMhandsome-lion-1748
09/13/2022, 8:46 AMdamp-kangaroo-1521
09/13/2022, 9:00 AMstale-optician-85950
09/13/2022, 9:17 AMdamp-kangaroo-1521
09/13/2022, 9:19 AMMissing baseUrl in compilerOptions. tsconfig-paths will be skipped
Can't run because no spec files were found.
We searched for specs matching this glob pattern:
stale-optician-85950
09/13/2022, 9:21 AMnpx cypress run --spec "cypress/e2e/mobile/*"
It's difficult to give precise help without seeing your folder structure.stale-optician-85950
09/13/2022, 9:23 AM--spec
examples.damp-kangaroo-1521
09/13/2022, 9:35 AMstale-optician-85950
09/13/2022, 10:04 AMmobile-iOS
Have you tried npx cypress run --spec "cypress/e2e/mobile-iOS/*"
damp-kangaroo-1521
09/13/2022, 10:31 AMstale-optician-85950
09/13/2022, 10:40 AMnice-horse-33158
09/13/2022, 1:17 PMpolite-jordan-30716
09/13/2022, 3:11 PMgray-kilobyte-89541
09/13/2022, 3:15 PMpolite-jordan-30716
09/13/2022, 3:16 PMlittle-address-70980
09/13/2022, 4:14 PMgray-kilobyte-89541
09/13/2022, 4:28 PMstale-optician-85950
09/13/2022, 7:02 PMcy.request({
method: 'GET',
url: uniqueUrl,
headers: {
Authorization: Cypress.env('BASIC_AUTH'),
},
}).then(({ status }) => {
expect(status).to.eq(200);
});
https://docs.cypress.io/api/commands/request#Arguments "headers | null | Additional headers to send; Accepts object literal"little-address-70980
09/13/2022, 7:03 PMstale-optician-85950
09/13/2022, 7:04 PMbrief-toddler-73066
09/13/2022, 8:13 PMancient-island-31170
09/14/2022, 12:08 PMexport const Menu = [
{
id: 1,
title: "Home",
link: "/",
children: [],
},
{
id: 2,
title: "Consultants",
link: "#",
children: [
{ childTitle: "Find a Doctor", childTo: "/consultant/doctors" },
],
},
{
id: 3,
title: "Services",
link: "/services",
children: [
{
childTitle: "Clinical Laboratory",
childTo: "/services/laboratoryservices",
},
],
},
{
id: 4,
title: "Packages",
link: "/packages",
children: [],
},
];
and i want to check the links by going to the page and checking the url which matches with the list or not.
the code i wrote is:
const menus = Menu;
context("Nav items test", () => {
beforeEach(() => {
cy.visit("/");
});
it("should redirect to the expected pages", () => {
cy.get(".navbar-nav>li>a[href!='/#']").each((links, index) => {
cy.wrap(links).click();
cy.url().should("contain", links[0].href);
});
});
if i do it manually then it is working:
cy.get('[data-cy=nav-item]').contains('About').click()
cy.url().should('include', '/about/')
flaky-airport-12178
09/14/2022, 1:15 PM