WIP: remove symlink

This commit is contained in:
Catalin Constantin Mititiuc 2024-05-15 11:25:52 -07:00
parent fe9a18a14e
commit 98f8464aeb

View File

@ -9,19 +9,19 @@ chromeOptions.addArguments('--headless', '--disable-gpu', '--no-sandbox');
let driver;
beforeAll(async () => {
await symlink('../../../test/map1.svg', 'public/assets/images/test_map.svg');
});
// beforeAll(async () => {
// await symlink('../../../test/map1.svg', 'public/assets/images/test_map.svg');
// });
beforeEach(async () => {
driver = new Builder().forBrowser('chrome').setChromeOptions(chromeOptions).build();
console.log('manage', await driver.manage());
// console.log('manage', await driver.manage());
await driver.get('http://localhost:3005');
});
it.only('loads the page', async () => {
it('loads the page', async () => {
expect(await driver.getTitle()).toEqual('Infantry Combat Solo Basic');
// console.log('window', window);
@ -43,6 +43,7 @@ it.only('loads the page', async () => {
});
it('selects an off-board soldier', async () => {
// it.only.each(Array(10).fill(null))('selects an off-board soldier', async () => {
await driver.switchTo().frame(await driver.findElement(By.css('object')));
const selector = '.counter[data-allegiance="attacker"][data-number="1"]',
@ -58,9 +59,9 @@ afterEach(async () => {
await driver.quit();
});
afterAll(async () => {
await unlink('public/assets/images/test_map.svg');
});
// afterAll(async () => {
// await unlink('public/assets/images/test_map.svg');
// });
async function takeScreenshot(driver) {
const dir = './test/screenshots';