Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Adding tests (jest/puppeteer) to pipeline" #53

Merged
merged 1 commit into from
Jun 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,5 @@
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"overrides": [
{
"files": ["*.test.js"],
"rules": {
"no-undef": "off"
}
}
]
}
}
16 changes: 0 additions & 16 deletions .github/workflows/node.js.yml

This file was deleted.

80 changes: 36 additions & 44 deletions __tests__/fortuneCookie.test.js
Original file line number Diff line number Diff line change
@@ -1,47 +1,39 @@
describe("Basic user flow for Website", () => {
// First, visit the fortune cookie website
beforeAll(async () => {
await page.goto(
"https://cse110-sp23-group20.github.io/fortune-teller/source/FortuneCookie/"
);
});
describe('Basic user flow for Website', () => {
// First, visit the fortune cookie website
beforeAll(async () => {
await page.goto('http://127.0.0.1:5501/source/FortuneCookie/');
});

// Check to make sure that button is enabled when page loads
it("Make sure button is enabled", async () => {
console.log("Checking to make sure button is enabled...");
let buttonDisabled;
const button = await page.$("button");
let booleanValue = await button.getProperty("disabled");
buttonDisabled = await booleanValue.jsonValue();
expect(buttonDisabled).toBe(false);
}, 5000);
// Check to make sure that button is enabled when page loads
it('Make sure button is enabled', async () => {
console.log('Checking to make sure button is enabled...');
let buttonDisabled;
const button = await page.$('button');
let booleanValue = await button.getProperty('disabled');
buttonDisabled = await booleanValue.jsonValue();
expect(buttonDisabled).toBe(false);
}, 5000)

// Check to make sure that button disables when it is clicked
it("Make sure button disables", async () => {
console.log("Checking to make sure button disables when clicked...");
let buttonDisabled;
const button = await page.$("button");
await button.click();
let booleanValue = await button.getProperty("disabled");
buttonDisabled = await booleanValue.jsonValue();
expect(buttonDisabled).toBe(true);
}, 5000);
// Check to make sure that button disables when it is clicked
it('Make sure button disables', async () => {
console.log('Checking to make sure button disables when clicked...');
let buttonDisabled;
const button = await page.$('button');
await button.click();
let booleanValue = await button.getProperty('disabled');
buttonDisabled = await booleanValue.jsonValue();
expect(buttonDisabled).toBe(true);
}, 5000)

// Check to make sure that button reenables after it is clicked
// it('Make sure button is reenabled', async () => {
// console.log('Checking to make sure button reenables after being clicked...');
// // Wait because it takes time until button is reenabled as it has to read out the fortune
// await page.waitForTimeout(15000);
// let buttonDisabled;
// const button = await page.$('button');
// let booleanValue = await button.getProperty('disabled');
// buttonDisabled = await booleanValue.jsonValue();
// expect(buttonDisabled).toBe(false);
// }, 20000)

// Check to make sure audio disables if user unchecks 'toggle voice' checkbox
// it('Make sure audio disables', async () => {
// console.log('Checking to make sure audio disables after \'toggle voice\' is unchecked...');
// // Wait because it takes time until button is reenabled as it has to read out the fortune
// }, 15000)
});
// Check to make sure that button reenables after it is clicked
it('Make sure button is reenabled', async () => {
console.log('Checking to make sure button reenables after being clicked...');
// Wait because it takes time until button is reenabled as it has to read out the fortune
await page.waitForTimeout(10000);
let buttonDisabled;
const button = await page.$('button');
let booleanValue = await button.getProperty('disabled');
buttonDisabled = await booleanValue.jsonValue();
expect(buttonDisabled).toBe(false);
}, 15000)
});
Loading