improve drivers

This commit is contained in:
shelly_goldblit
2023-12-30 11:49:03 +02:00
parent 124ae98bf3
commit 9014e12ca6
7 changed files with 203 additions and 917 deletions
+6 -22
View File
@@ -5,37 +5,21 @@ export default class CypressWrapperDriver {
public given = {
...this.helper.given,
/**
*
* @param url a url to a file, this assumes the file name is the last part of the url
* @param alias
*/
interceptGetToFile(url: string) {
let fileNameAndAlias = url.split('/').pop();
cy.intercept('GET', url, { fixture: fileNameAndAlias }).as(fileNameAndAlias!);
},
interceptAndIgnore(url: string) {
cy.intercept({ method: "GET", url }, []);
}
}
};
public get = {
...this.helper.get,
elementByClassOrType(slector: string) {
return cy.get(slector);
}
}
},
};
public when = {
...this.helper.when,
visit(address: string) {
cy.visit(address);
},
confirmAlert() {
cy.on("window:confirm", () => true);
}
}
},
};
public beforeAndAfter = this.helper.beforeAndAfter;
}
}