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

CON-2957 Tests(DPxAI): upload test for quest02 first-wink #2693

Merged
merged 1 commit into from
Aug 30, 2024

Conversation

lotoussa
Copy link
Contributor

@lotoussa lotoussa commented Aug 20, 2024

CON-2957

I'm not sure how to handle test for dom...

from
bash ./test_with_container.sh -l dom -s solution.zip first-wink
`Building test image based on branch:
[+] Building 8.5s (9/9) FINISHED docker:desktop-linux
=> [internal] load .dockerignore 0.1s
=> => transferring context: 2B 0.0s
=> [internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 152B 0.0s
=> [internal] load metadata for docker.io/buildkite/puppeteer:7.1.0 1.0s
=> [1/4] FROM docker.io/buildkite/puppeteer:7.1.0@sha256:1aeb4f650298b9e483cff03a77fbc9e69ceadd61d27d62ad6017af848fd92dd1 0.0s
=> [internal] load build context 7.3s
=> => transferring context: 142.12MB 7.2s
=> CACHED [2/4] WORKDIR /app 0.0s
=> CACHED [3/4] COPY dom . 0.0s
=> CACHED [4/4] COPY subjects ./subjects 0.0s
=> exporting to image 0.0s
=> => exporting layers 0.0s
=> => writing image sha256:c861bf410ee60df7a7661ff4d1cf92166969ff8f3a19ce29677047cdc9136517 0.0s
=> => naming to docker.io/library/test-image 0.0s

What's Next?
View summary of image vulnerabilities and recommendations → docker scout quickview
Content sent to runner:
Archive contains:
first-wink.css
first-wink.html
first-wink.js
Total 3 entries (2537 bytes)
Sending to runner...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1547 100 120 100 1427 68 820 0:00:01 0:00:01 --:--:-- 889
GET /first-wink/first-wink.html
GET /first-wink/first-wink.css
GET /first-wink/first-wink.js`

@lotoussa lotoussa added the 🧪 test Tests label Aug 20, 2024
@lotoussa lotoussa self-assigned this Aug 20, 2024
@lotoussa
Copy link
Contributor Author

testing with a wrong solution :

`GET /first-wink/first-wink.html
GET /first-wink/first-wink.css
GET /first-wink/first-wink.js
test #1 failed:
async ({ eq, page }) => {
// click the button to close the left eye
const button = await page.$('button')
button.click()

// check that the class has been added
await page.waitForSelector('#eye-left.eye.eye-closed', { timeout: 150 })

// check the background color has changed
await eq.$('#eye-left.eye.eye-closed', {
style: { backgroundColor: 'black' },
})

// check that the text of the button changed to 'open'
await eq.$('button', { textContent: 'Click to open the left eye' })
}
TimeoutError: waiting for selector #eye-left.eye.eye-closed failed: timeout 150ms exceeded
at new WaitTask (/node_modules/puppeteer/lib/cjs/puppeteer/common/DOMWorld.js:509:34)
at DOMWorld.waitForSelectorInPage (/node_modules/puppeteer/lib/cjs/puppeteer/common/DOMWorld.js:420:26)
at Object.internalHandler.waitFor (/node_modules/puppeteer/lib/cjs/puppeteer/common/QueryHandler.js:31:77)
at DOMWorld.waitForSelector (/node_modules/puppeteer/lib/cjs/puppeteer/common/DOMWorld.js:313:29)
at Frame.waitForSelector (/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:841:51)
at Page.waitForSelector (/node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:1280:33)
at file:///app/first-wink_test.js:19:14
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Server. (file:///app/test.js:147:11)`

@nprimo
Copy link
Contributor

nprimo commented Aug 20, 2024

@lotoussa the log reported here is a "pass".
As expected, when you tested a wrong solution, the test logs some errors, as the log you pasted here

Most of our tests don't log anything if the solution passes the tests. If there is a mistake (in the solution or tests), you should see a log message.

Copy link
Contributor

@nprimo nprimo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

Copy link
Contributor

@Oumaimafisaoui Oumaimafisaoui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Oumaimafisaoui Oumaimafisaoui merged commit 0b62945 into master Aug 30, 2024
5 checks passed
@Oumaimafisaoui Oumaimafisaoui deleted the CON-2957-tests-d-px-ai-quest-02-ex-00 branch August 30, 2024 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants