mysterious-belgium-25713
10/08/2022, 9:00 PMstale-optician-85950
10/08/2022, 9:00 PMcy.request
but you can verify that mailto
is present:
describe('Test application', () => {
it('Validate email button', () => {
// stop the cookie banner from appearing by setting the cookie
cy.setCookie('consentUUID', '57261086-58c8-4b80-9c02-647d417b9861_12');
cy.visit('https://www.businessinsider.com/ikea-nyc-store-planning-studio-tour-2019-4');
cy.get('[aria-label="Click to email"][data-e2e-name="share-link-email"]')
.first()
.invoke('attr', 'href')
.then(email => {
cy.log('email link:', email);
expect(email).to.include("mailto:?subject=I visited Ikea's new Manhattan location");
expect(email).to.include('www.businessinsider.com');
});
});
});
mysterious-belgium-25713
10/08/2022, 9:01 PMstale-optician-85950
10/08/2022, 9:03 PMflaky-raincoat-53097
10/08/2022, 9:07 PMprehistoric-restaurant-72560
10/08/2022, 9:08 PMprehistoric-restaurant-72560
10/08/2022, 9:10 PMstale-optician-85950
10/08/2022, 9:12 PMflaky-raincoat-53097
10/08/2022, 9:14 PMflaky-raincoat-53097
10/08/2022, 9:14 PMflaky-raincoat-53097
10/08/2022, 9:14 PMprehistoric-restaurant-72560
10/08/2022, 9:16 PMstale-optician-85950
10/08/2022, 9:18 PMflaky-raincoat-53097
10/08/2022, 9:20 PMflaky-raincoat-53097
10/08/2022, 9:21 PMflaky-raincoat-53097
10/08/2022, 9:21 PMflaky-raincoat-53097
10/08/2022, 9:21 PMmysterious-belgium-25713
10/08/2022, 9:43 PMstale-optician-85950
10/08/2022, 10:05 PMdescribe('Test application', () => {
it('Assert all news items', () => {
// stop the cookie banner from appearing by setting the cookie
cy.setCookie('consentUUID', '57261086-58c8-4b80-9c02-647d417b9861_12');
cy.visit('https://www.businessinsider.com/latest');
// prepare news items requests
cy.get(
'[class="river-item featured-post"] [class*="js-feed-item"] [class="tout-text-wrapper default-tout"] a'
).then($elReults => {
for (let i = 0; i < $elReults.length; i += 1) {
cy.wrap($elReults)
.eq(i)
.then($el => {
cy.wrap($el)
.invoke('attr', 'href')
.then(url => {
cy.request(url).then(resp => {
expect(resp.status).to.eq(200);
});
});
});
}
});
});
});
flaky-raincoat-53097
10/08/2022, 10:28 PMflaky-raincoat-53097
10/08/2022, 10:29 PMrefined-intern-1673
10/09/2022, 12:40 AMcypress.config.js
is pretty straightforward
const { defineConfig } = require("cypress");
module.exports = defineConfig({
component: {
devServer: {
framework: "vue",
bundler: "webpack",
webpackConfig: require("./webpack.mix.js"),
},
},
});
And seems to run fine up until I actually try to run a component spec. I let Cypress generate a spec for me based on my component, and that seems fine up until it actually tries to load the component, at which point I get the following (non-Cypress) error:
> Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> <template>
| <div class="px-4 py-8 flex items-center justify-between sm:px-0" :class="reverse ? 'flex-row-reverse' : 'flex-row'">
| <slot name="paginationCount">
My webpack is definitely configured to load Vue files, I don't think our site would run without that 😅 So I'm thinking there's some divide between what Cypress expects for Webpack and what Mix provides but I've been down a rabbit-hole of non-solutions tonight and figured this might be a good place to reach outplain-pencil-72796
10/09/2022, 8:55 AMpurple-afternoon-2408
10/09/2022, 11:01 AMbrainy-translator-85865
10/09/2022, 12:04 PMthankful-dawn-86064
10/09/2022, 6:05 PMthankful-dawn-86064
10/09/2022, 6:06 PMmysterious-belgium-25713
10/09/2022, 6:30 PMthankful-dawn-86064
10/09/2022, 6:30 PMmysterious-belgium-25713
10/09/2022, 6:31 PM