DEV Community

Leonardo Cumplido
Leonardo Cumplido

Posted on

2 2

Seventh-week check in for PSF, GSoC 2021

Hi! This weeks check in may be short but interesting. Firstly, I was given great news: I passed the first evaluation 😃. Now, the second period begins, and I plan to keep my good workflow ongoing.

What did I do this week?

I focused on my third milestone. I made two challenges for the course. The first one is a called Hangman challenge, and it is about creating a hangman game. The hard thing was coding its web test. I'll explain this later. The second challenge is called Pergamino challenge, and it is about deciphering a parchment with Python code. This was very straightforward, even its web test.

Did I get stuck anywhere?

Yes. The playwright test for the hangman challenge was tricky. Interacting with the exercises of this challenge meant dealing with several dialog prompts. I already knew how to accept one dialog prompt:

page.on("dialog", lambda dialog: dialog.accept("sth"))
Enter fullscreen mode Exit fullscreen mode

But I had trouble when more than one needed to be handled in the same test. By looking at playwrights documentation I found a solution. First, expect for the dialog event to appear on screen. Then, accept that single dialog once. This, translated to code, is:

with page.expect_event("dialog") as prompt1:
    page.once("dialog", lambda dialog: dialog.accept("sth"))
with page.expect_event("dialog") as prompt2:
    page.once("dialog", lambda dialog: dialog.accept("sth"))
Enter fullscreen mode Exit fullscreen mode

What is coming up next?

I made two PRs this week. Both are regarding the new challenges. They are still awaiting review. So this week I will tackle the review suggestions, and will review my peers PRs.

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay