
* reference type cypress working * refactor * remove screenshots * add reference * add slash marker * run tests based on shop version * fix run tests based on shop version * fix run tests based on shop version * change base url to localhost * fix plugins * fix plugins * fix plugins * fix plugins * fix plugins * fix plugins * fix yml * fix yml * chage file names * fix files names * fix broken imports add checking for errors in grpah responses * fix broken imports add checking for errors in grpah responses * update jest * fix snapshot
38 lines
712 B
JavaScript
38 lines
712 B
JavaScript
export function getPage(pageId, auth = "auth") {
|
|
const query = `query{
|
|
page(id:"${pageId}"){
|
|
title
|
|
isPublished
|
|
attributes{
|
|
values{
|
|
inputType
|
|
name
|
|
}
|
|
attribute{
|
|
id
|
|
inputType
|
|
}
|
|
}
|
|
}
|
|
}`;
|
|
return cy.sendRequestWithQuery(query, auth).its("body.data.page");
|
|
}
|
|
|
|
export function createPage({ title, pageTypeId }) {
|
|
const mutation = `mutation{
|
|
pageCreate(input:{
|
|
title:"${title}"
|
|
pageType:"${pageTypeId}"
|
|
}){
|
|
errors{
|
|
field
|
|
message
|
|
}
|
|
page{
|
|
title
|
|
id
|
|
}
|
|
}
|
|
}`;
|
|
return cy.sendRequestWithQuery(mutation).its("body.data.pageCreate");
|
|
}
|