sseerrppeenntt

sseerrppeenntt

Hello friends,

I am seeking advice on how to proceed with my personal web automation project. :slight_smile:

In recent months I finished my first back-end app using Python on a Linux server. I use it to watch over a clothing website’s homepage, that is the appearance of new product notification modals DOM changes, to send myself a push notification to my phone using the Matrix CLI utility matrix-commander when a new product is added. The whole app is built upon Selenium/ChromeDriver library’s explicit wait loops.

Python example:

WebDriverWait wait = new WebDriverWait(driver,30);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.ID("garment")));

With the introduction out of the way, let’s look at the “problem”. I would like to rebuild this app using Elixir; for these reasons:

  • a fun experience to learn Elixir
  • better interoperability with my Phoenix app

I am but an Elixir novice, therefore I have many questions:

  1. What app structure would you suggest? In Python it was simply a deeply nested loop that corrected itself with another loop on an error-raise, but I am unsure how I would do this in Elixir.
    1.1. How would you utilize Elixir’s fault-tolerance to keep this “sentry app” running?
    1.2. If I wanted it running alongside a Phoenix app, is an Elixir umbrella project a suitable option?
    2. The most mature library for web automation using ChromeDriver seems to be Wallaby, but it’s implementation is with the ExUnit test blocks (now feature blocks) and I am unsure if it would work outside these ExUnit tests. Is it possible to run such code without the feature block? Or is it better to somehow run the program in them? Example code:
  feature "users can create todos", %{session: session} do
    session
    |> visit("/todos")
    |> fill_in(text_field("New Todo"), with: "Write my first Wallaby test")
    |> click(button("Save"))
    |> assert_has(css(".alert", text: "You created a todo"))
    |> assert_has(css(".todo-list > .todo", text: "Write my first Wallaby test"))
  end

I would be grateful for any insights that you might bring. :heart:

Showing Posts 1 to 2

dimitarvp

dimitarvp

Sorry that you had no engagement. Have you tried something that you can show here so maybe then people can give more concrete advice?

sodapopcan

sodapopcan

The company I used to work for did use Wallaby outside of testing in production code, so I know it’s possible. Unfortunately I barely worked in that area of the codebase and when I did, it was only touching our wrappers. I know my former-colleagues do lurk around here but they rarely post, so I’m not sure if they will see this. The best I can offer is a tiny bit of reassurance that if you go down that path it probably won’t be in vain.

You otherwise likely weren’t getting traction here as your first question is very general about Elixir. GenServers and Supervisors are what you are looking for as they are the basic building blocks of long running fault-tolerant systems akin to the Python code described.

— All posts loaded —

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
webofbits
Aludel - LLM Evaluation Workbench Aludel is an embeddable Phoenix LiveView dashboard for evaluating and comparing LLM prompts across mult...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews