Project

General

Profile

Actions

Agama and Puppeteer Need To Know » History » Revision 1

Revision 1/4 | Next »
rainerkoenig, 2024-08-23 12:00
First notes of what I found out


Agama and Puppeteer Need To Know

Basic ideas and concepts

  • Agama should be tested by using the Puppeteer library instead of the Playwright framework
  • Puppeteer is JavaScript
  • Nevertheless we would like to use TypeScript for our tests, because TypeScript has the advantage of data types that can be checked

Typescript to JavaScript conversion

I watched this video which explains how we can convert TypeScript sources to JavaScript:

  • npx tsc converts files to JavaScript.
  • npx tsc --watch triggers the watch mode, so every time you modify a *.ts file it will be translated to JavaScript automatically.

The first test runs

To try this out (as of August 23, 2024) I cloned Joaquin's repo on GitHub to my local machine running Leap 15.6.

The installation test was performed on a VM using the agama-installer.x86_64-9.0.0-openSUSE-Build11.9.iso image. What you need to do when booting this:

  • Edit the bootloader settings and append live.password=nots3cr3t to the kernel parameter line
  • After the machine is up switch to a virtual console and check the IP settings, in my case the IP of the VM was 192.168.0.50

Then switch to your local repo and use this commands:

export AGAMA_SERVER=http:/192.168.0.50  # or whatever your VM has as an IP
export AGAMA_HEADLESS=0 # so you see a browser window

./agama-integration-tests build/test_install.js

The last line starts the test script which is already installed and put into the build directory.

My findings

  • On Leap 15.6 we get failures when using Firefox (which is the default browser defined in the code). So I need to switch by setting export AGAMA_BROWSER=chromium (or chrome).
  • Running in Chroimium or Chrome on Leap 15.6 looks a bit better, but I stil got failures. Digging into this revealed that the problem were my language settings which caused some parts of the Agama UI to be translated. To solve this I had to set export LANG=en_US.utf8.
  • With those settings I am able to almost pass the test:
  ​ Agama test
    ✔ should have Agama page title
    ✔ allows logging in
    ✔ should optionally display the product selection dialog (30760ms)
    ✔ should have an Overview section
    ✔ should allow setting the root password
    ✔ should be ready for installation
    ✔ should create first user
    1) should start installation


  7 passing (34s)
  1 failing

  ​ 1) Agama test
       should start installation:

      AssertionError: expected 'Configuring the product, please wait …' to deeply equal 'Installing the system, please wait ...'
      + expected - actual

      -Configuring the product, please wait ...
      +Installing the system, please wait ...

      at Context.<anonymous> (tests/test_install.ts:237:45)

The interesting part is that the installation in this case is really triggered, you can see it in the UI of the Agama VM. So this seems to be just a minor issue.

So my next attempt was using my *Tumbleweed VM which I first updated. Then cloning my repo to the VM and putting the settings for AGAMA_SERVER and AGAMA_HEADLESS.

In this configiruation I was able to perform a full installation using Firefox. It was not completely reproducible, some attempts also resulted in errors, but some runs really performed the install.

Updated by rainerkoenig 3 months ago · 1 revisions