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;
}
}