HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/shop.komma.nl/tests/Cypress/support/pagesInfo.js
export default class PagesInfo {
    pages = [];

    constructor() {
        this.pages.push((new PageInfo()
            .setName('home')
            .setLocations({
                'nl': '/'
            })
        ));

        this.pages.push((new PageInfo()
                .setName('assortment')
                .setLocations({
                    'nl': '/nl/assortiment'
                })
        ));

        this.pages.push((new PageInfo()
                .setName('cart')
                .setLocations({
                    'nl': '/nl/winkelwagen'
                })
        ));

        this.pages.push((new PageInfo()
                .setName('customer_details')
                .setLocations({
                    'nl': '/nl/checkout/gegevens'
                })
        ));

        this.pages.push((new PageInfo()
                .setName('confirmation')
                .setLocations({
                    'nl': '/nl/checkout/confirmation'
                })
        ));

        this.pages.push((new PageInfo()
                .setName('productDetail')
                .setLocations({
                    'nl': '/nl/producten/'
                })
        ));

        this.pages.push((new PageInfo()
                .setName('siteLogin')
                .setLocations({
                    'nl': '/nl/inloggen/'
                })
        ));

        this.pages.push((new PageInfo()
                .setName('myAccount')
                .setLocations({
                    'nl': '/nl/mijn_account/'
                })
        ));

        this.pages.push((new PageInfo()
                .setName('register')
                .setLocations({
                    'nl': '/nl/registereren'
                })
        ));
    }

    getByName(name) {
        const pages = this.pages.filter(page => page.name === name);
        if(pages.length !== 1) throw Error('No info for page "'+name+'" found.');
        return pages[0];
    }
}

class PageInfo {
    name;
    locations;

    setName(value) {
        this.name = value;
        return this;
    }

    setLocations(locations) {
        this.locations = locations;
        return this;
    }
}