< Back

Getting AWS certified, learning Playwright and Appium, all in my first month

Author

Wim Raes

Date

13/09/2022

Share this article

The first month of work is in the books, no better way to relax than writing a blog post about it.

Honestly, I’m having a very hard time remembering what my very first day was like because my brain is already jam-packed from learning so much new stuff this past month. Yes, this is a good thing!

AWS Cloud Practitioner

During my first week I was given the assignment of preparing for the Amazon Web Services (AWS): Cloud Practitioner exam. I spent a lot of time using the AWS resources that Amazon provides on their training platform. It was a great way of preparing for the exam and learning all about the wonderful services AWS provides.

After passing the exam (Hurray me!), Koen suggested I should practice and spend time learning about different test automation frameworks as I’m not working on a project with a client right now. The tools that I took a closer look at were: Playwright, developed by Microsoft, and Appium, a framework for mobile testing.

Playwright

As I got into Playwright, I was so surprised about how easy it was to set it up and start writing tests. The documentation provided on their website is very well written and super comprehensive. Just installing Playwright gives you access to many tools right out of the box:

Built in assertion library that works like a charm.

async assertRecordIsDeleted(recordnumber){ 

        await expect(this.#getRecord.locator(`#delete-record-${recordnumber}`)).not.toBeVisible(); 

    } 

Testing on multiple browsers all at once? No problem. Just alter your config file with some easy tags, and you’re set.

projects: [ 

    { 

      name: 'chromium', 

      use: { ...devices['Desktop Chrome'] }, 

    }, 

    { 

      name: 'firefox', 

      use: { ...devices['Desktop Firefox'] }, 

    }, 

    { 

      name: 'webkit', 

      use: { ...devices['Desktop Safari'] }, 

    }, 

    { 

      name:'Pixel 4', 

      use:{ 

        browserName:'chromium', 

        ...devices['Pixel 4'] 

      } 

    } 

  ], 

Or if you want to record videos or screenshots of the tests you ran you could also implement this in the configuration file by adding certain conditions on when these recordings should occur:

const config = { 

  use: { 

    headless: true, 

    trace: 'on-first-retry', 

    screenshot:'only-on-failure', 

    video:'retain-on-failure', 

    trace:'retain-on-failure' 

  }, 

An even bigger plus is the Playwright Trace Viewer. A nifty tool that lets you track what happened in your tests, particularly useful for debugging purposes.

A few days later after I rounded up my Playwright workout-session I dove right into Appium.

Appium

Setting up Appium takes a while. Luckily, there’s a nifty package you can install to check Appium’s settings: Appium-doctor.

This appium-doctor command checks what’s wrong with the android settings and suggests how you can solve the issues.

Text

Description automatically generated

After fixing the issues, run the same command again and it should work and look like this:

Text

Description automatically generated

After a rather tedious process of setting up Appium, which I won’t elaborate on in this blogpost, you can finally get to writing tests on both Android and iOS. I chose to work in Appium with the webdriver.io framework.

Learning how to write a test in Appium was difficult. Figuring out desired capabilities and the different drivers, required to run your tests on a mobile device, also took some time.

config.capabilities = [ 

    { 

        path: '/wd/hub', 

        port: 4723, 

        browserName: 'Safari', 

        platformName: 'iOS', 

        maxInstances: 1, 

         

        // For W3C the appium capabilities need to have an extension prefix 'appium' 

        'appium:deviceName': 'iPhone 8', 

        'appium:platformVersion': '15.5', 

        'appium:orientation': 'PORTRAIT', 

        'appium:automationName': 'XCUITest', 

        'appium:newCommandTimeout': 2000, 

         

    }, 

]; 

Reading Appium documentation was, in stark contrast to Playwright, harder than I would have wanted it to be. A separate blogpost about Appium is on my to-do list, since it is such an interesting tool.

Even though I struggled for a while, I hit a stride when I figured out how the webdriver.io test runner worked. It’s nice running all your tests on different devices thanks to the configuration files that you can create and run with the test runner using the CLI:


npx wdio run ./wdio.android.browser.conf.js

A very educational first month

As you can probably figure out by now: I learned a lot over the past few weeks just by playing around with these different frameworks.

Overall, this first month was a great experience. I was given time and resources to earn a valuable AWS certificate and improve my knowledge on different test automation frameworks that I inevitably will have to use on the job.

Being given the opportunity to spend time and hone your skills is a very underrated perk that few people can boast about. Luckily, I can.

One month down, many more to go!