Daniel Knott
Now, I would like to talk about Remove The Pain from Mobile Test Automation for the remaining time. And why? Why I would like to talk about it? And I've seen lots of tools not only from mobile but also from the web space and other stuff. There's sometimes the tools are so complicated to set up it needs if not days to have a solid setup up and running integrated in your pipeline and so forth. Therefore, tools must be simple to use. That's it. We as developers or testers, we're just like users of that product of the automation tool. And that's why the tools must be simple to use. Otherwise, I would go somewhere else. Tools must fit the needs. That's what I mentioned before. Do your homework and check what tool is best for your needs. Otherwise, you might pick the wrong one. You would like to cost saving. You would like to save costs with tools. That's also really important. Just take a look at what's the cost structure of the tool. Is it an open source tool? Is it a paid tool? How does it integrate into your environment and so forth? And can you save costs and time with a tool? And also, last but not least, it should be easy to integrate in your pipeline. And without that, I would like to talk about today about Maestro. Yes. It's a new kit on the block in the automation space, if you haven't seen it before. Let's take a look at together because I think it's a really, really great example how easy tool can be, how simple it can be to set up, and how simple it can be to write automation from a user's point of view. User's point of view, user journeys. That's what we like to talk about today. Let's jump right into the hands on demonstration. If we open up the Maestro page, which is Maestro.mobile.dev, you end up on that landing page, right? So it's a lot of information here, like what is Maestro, how it can be used and what. On the left hand side you have a really great view of things that are important to learn about Maestro. Everything is documented from examples, from how to integrate with Android, with iOS, with UIKit, with Swift, React Native, and whatnot. It's really easy to follow up on. And also you have installation instructions here and that's the cool part. So if you would like to install, you can install it on Mac, on Windows, and on the Linux system. I'm on a mac today, so I would like to show you how easy it is to install Maestro and to do the very first things with it. Yeah, for you to mention, I already have an emulator, an emulator up and running for an easier demonstration purposes today. But you can also use Maestro on real devices as well. What I'm doing right now, I'm copying the installation command curl, blah blah blah, and I will put that right now into my environment. As you can see, here we are on the terminal. And for you to show that, let's do the installation. Copy pasting it, hit the enter button. Now we're downloading all the resources to the computer. Depending on your internet connection just might take longer or it's even faster. It's checking extracting. Done. Maestro installed. We can start automating it. That's it. Nothing more to do, no prerequisite, nothing. But what we now do is type in Maestro. And as we can see here, we have some information that's missing, but that's the sub command. Right now we can see what we can do with Maestro. Make this one a bit bigger here. So you can see, as we can see here, we can use Maestro already. If you check the documentation, what you can do here is one thing that is really cool about Maestro. It's coming with Maestro studio. And if we do like this Maestro studio, we are starting now. We have the emulate up and running so we can see the emulator. We have now Maestro studio up and running. It's opening up in a console and here you can see basically the emulator, right? So what you can see here, you get a direct view as well in your browser. So in case we navigate on the device in a few seconds later, we have the representation here as well. And the cool thing is, Maestro, already provide you with some really simple flows that you can already use in order to interact with something. For example, let's say we tap on Gmail. Oops. We tap here, can click play, which has played at one. We can see here we open up the Gmail account. And that's the cool thing about Maestro. You don't need to have access to the code base of the app that you would like to test. Just go to the app store, download any app that you would like to automate and then go for it. Go for it and automate it. And that's the really cool thing. That we can say, okay, let's use this one or we can say, okay, we can copy it now we have copied it, we can put it into our flow, into our Yaml flow package, so to say. But what I would like to show you here is though, to actually automate the messaging it. That's what I wanted to say. What we can see here, we started the app basically. No, I did something wrong. Give me a second. That's the thing we would like to take here. So what is this? We can double tap on the Maestro studio to get basically the command that we would like to use so we can say here, tap on messages and we can now create. That's an example. Yes. So we can basically get rid of this one. I prepared this something here. That's basically just structure. You have to use Yaml files in order to write as per Maestro test. So you can use to identify the app id that you would like to test. You provide this as well. You can say launch the app and say clear state true so that the app that you would like to test is always in the same state as you would like to have it. That's what we have. And now we can just run it, right? We have a really simple script here that is starting. So we open up a new window. Okay, Maestro test, first test yaml, and then we click that and we can see here we are just now starting the flow. We launched the app, we put it in the clear state and that's it basically. That's what we have done already. And so what else we can now do is now that you can see the view has changed. We got the latest view as well. We can say, okay, I would like to have this one. And then you click on it and you get specific information from Maestro again, so you can get the ID, you can get the text that you would like to tap. For now, let's just tap on the button. We go back to our here. Let's make this one again a bit bigger. We have this one as well. We tap that and now we can run it again. Let's see just do the same thing. We run it, as you can see here, some two steps. We open up the app, we have the clear state. We tap on use messages without an account. Here we are. Next test is passing. Now we can close this one as well. We say, okay, we would like to see this one. We can tap it, but nothing is going to happen if we tap it, right? That's the visual representation. Assert. Then we can say Assert visible and check that this actually the image is visible. We're copying it. Now we can run it. We can see here we're putting the app in a clear state again, we tap the button, we log in without an account and we verify that the ID is visible. That's really cool. And as you can see, it's fairly simple to basically write your automation script with Maestro studio. And of course, if you're more familiar with the whole syntax of it, you can just go ahead and do just check on the IDs and then use the commands that you can use in order to automate and that the commands is really cool. You have everything over here, so we have flows, of course you have the flows, you have the nested flows, you can use JavaScript in order to enrich the automation scripts and so forth and so forth. What I also wanted to show you here today is basically the samples. In case you would like to see in advance flow of Maestro, we have an advanced law Yaml filing as well. As you can see here, that's example files from Maestro. Here we would like to test the Wikipedia. We have some text advanced and we have some subflows. So here we have a flow, a subflow defined. So run the subflow. And if we go into that folder, which is called subflows, and then we have the Android onboarding, you can see here that we are launching the app that we are tapping a few buttons. Yeah. And then we check on some search container, then we run the script and then we have some inputs text. So let's see what's the script all about. We go into scripts. We enter qwerty here or get this, and then we have the input text and the assertion that we are also checking as well from that more advanced test case, it's a test case that you do. And that's basically the really quick hands on demonstration. I would like to show you. Look how easy it is to set up Maestro just by a couple of seconds that is running and then you can start right away with Maestro studio to actually automate, get information from the app that you would like to test, copy paste it over and then make use of it. And also, if you are like checking Maestro already, they are also working on more AI capabilities for you to make it even more reliable, more faster, and yeah, basically to remove the pain from test automation. That's the most important thing because maybe you've used Appium before or other tools and it's pain in the ass sometimes to set them up. Sorry for my words to actually get it up and running. And that's not what should happen, right? We are users of the tools and we would like to have good tools as well. And that's why I'm a big fan of Maestro. If you haven't seen it before, you haven't tried it out, go ahead and check it out to learn all about Maestro today.