Hi, I'm Vadim, I'm a front-end engineer from Delivery Hero, and today with my colleague Devesh, I want to present you the adaptation of the end-to-end test which we have done for our project in Delivery Hero. The agenda for today would be the case study for the end-to-end tests, or why we are start doing that, the end-to-end test setup, and the best practices we use, then how to avoid repeating this cycle while developing tests, and how we are testing different variations of the feature.
So the case study for the end-to-end were pretty simple and common like for everyone, because Delivery Hero is a huge company with a huge front-end project, it takes a lot of time and effort to maintain and develop it, so we thought that it's a big improvement to the situation to introduce the end-to-end test so we don't need to do manually testing features every time or debug fixes, so we can improve our resilience and the calmness while deploying a big change. So just to have an overview of the scale, we have more than 20 front-end developers, we do the 10 pull requests daily, our micro-front-end repo has more than 50k total lines of code without node modules, and the monolith have the old monolith have the 200k total lines of code, so it's quite big.
The end-to-end setup we have is basically a separate repo, because we added the tests while we are migrating from the old project to the mono-repo with the micro-front-ends, and we have like simplicity of running the test in the separate repo so we can easily onboard developers. For now, we run them as a cron job, yeah, we know that it's not a standard, let's say, but we are working on the integration to the CICD pipelines, and we created our own custom Slack integration with Cypress. We know that there is an official plugin developed last week, but yeah, we still have our own for now. Yeah, you can see the example of what the Slack bot is a message with the report, and you can click on the report button and check this kind of report, which is very helpful because it shows like the stack trace, the error, exactly error, and the screenshot. We also, of course, are using some best practices from the Cypress team and some of our own, which is trying to use accessibility principles in the test created by Ken Dodds, which is the testing library creator. So instead of using data CI, which is a best practice from Cypress team, we can use the area labels and other accessibility attributes, which is very helpful and handy. We also, of course, use the Cypress commands for general helpers, like if something is used in separate specs, or more than two times, we just wrap it into the command and use it as a one-liner, which is simpler. As well, we are using like a given annotation, but not only as a structure for the test, but also, as a command, because as you see here in an example, it's very helpful, because even if you remove the whole code, you still have an idea of what the test is going to test, because sometimes the commands can be complicated.
And now, I want to give over for Dinesh, please. Thank you, Vadim. Hi, everyone. So, Vadim like told quite good scenarios like what are the best practices we are following. So, I'll be going like guiding you through about two particular things that we are doing at our end, like which really helps us achieve a test very quickly. So, this one particular thing is about like how to avoid repeating the cycle. So, I mean, most of the E2Es that you see nowadays it's like a single flow. First, the user I mean, first the E2E goes through the one page, then the second place, and the third place. So, it's a sequential manner. But considering we are the 20 plus dev team, as Vadym mentioned, and like different teams are working on different pages or different modules, we don't want to actually repeat the whole cycle during the development. Like, we want to test our features, we want to test only our only our page. So, this will be something like this, okay? Going from one page to the directly to our page. So, how are we actually achieving it? So, we actually created a utility service in our utilities. I mean, not the utility, but you can say a command that Vadym mentioned. We have custom command, which is about go to the page. So, what happens in this particular command? So, this this could be any page. Like, this could be a go to my page and then I can actually mark the previous data about all the pages which came before it, like all the data that they added to the browser, to the storage, everything will be marked here. And what I'll be doing after this, so I'll be using the, like, SIPLESS window.
Comments