Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

links.map is not a function #2

Open
ShcherbakovDen opened this issue Sep 2, 2020 · 1 comment
Open

links.map is not a function #2

ShcherbakovDen opened this issue Sep 2, 2020 · 1 comment

Comments

@ShcherbakovDen
Copy link

I have tried ti use your code but i got error links.map is not a function.
I rewritten code as
`describe('broken link test', function() {
it('should check the page for broken links', async function () {
browser.url('/status_codes/200');

    // get all the links on the page
    const links = $$('a');

    const urls = (await links).map(link => link.getAttribute('href'));

    const requests = urls.map(url => fetch(url));

    const responses = await Promise.all(requests);

    const statusCodes = responses.map(response => response.status);

    statusCodes.forEach(statusCode => {
        expect(statusCode).to.be.below(400);
    })
});

});`

but now i take error "Only absolute URLs are supported"
Can you help me debug this code for right work?

Thanks in advance!

@ShcherbakovDen
Copy link
Author

Sorry. this error refers to https://github.com/wdio-wed/broken-link-check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant