Coder Social home page Coder Social logo

Comments (5)

kcpevey avatar kcpevey commented on June 27, 2024 1

There was some discussion around replacing cypress with playwright. I messed around with it for a bit today and was able to work through the first part of authenticating via google (which included working in incognito mode on chromium and it handled the redirects). Here is the code I was using as a POC:

from playwright.sync_api import sync_playwright
import dotenv
import os

dotenv.load_dotenv()

url = 'https://nebari.quansight.dev/user/[email protected]/lab'
google_email = os.environ['GOOGLE_EMAIL']
google_password = os.environ['GOOGLE_PASSWORD']

with sync_playwright() as p:
    browser = p.chromium.launch(headless=False, slow_mo=20)
    page = browser.new_page()
    page.goto(url)
    print(page.title())
    locator = page.get_by_role("button", name="Sign in with Keycloak")
    locator.hover()
    locator.click()

    page.locator("#social-google").click()  # get via element id

    # fill in email and click next
    page.get_by_label("Email or phone").fill(google_email)
    page.get_by_role("button", name="Next").click() 

    # fill in password and click next
    page.get_by_label("Enter your password").fill(google_password)
    page.get_by_role("button", name="Next")

    browser.close()

I'm happy to investigate this further or start setting something up.

from governance.

viniciusdc avatar viniciusdc commented on June 27, 2024

@kcpevey I think one interesting thing we could test out is login in a Nebari deployment and run a jupyter notebook within playwright

from governance.

kcpevey avatar kcpevey commented on June 27, 2024

I think one interesting thing we could test out is login in a Nebari deployment and run a jupyter notebook within playwright

I could do that, its just a few additional steps.

from governance.

iameskild avatar iameskild commented on June 27, 2024

Thanks a lot @viniciusdc for thorough RFD!! I definitely agree that improving our integration tests (along with CI) will go a long way to improving and speeding up the release process so I'm all for it!

To me, @kcpevey's example of playwright shows a lot of promise and would make adding and maintaining tests a lot easier. Although Cypress can perform many of these same types of tests, I feel resistance to adding new or improving existing tests mostly because of my lack of JS experience. Just like Cypress, we can run these tests during CI (kubernetes test) and during the integration tests!

I like the idea of making sure that, after each deployed stage, things are working as expected. We currently have a few checks in place that run after each stages, so I wonder if expanding on those would be sufficient. Perhaps instead of --stop-at we just run the full deployment but we can enable different level of checks.

This might looks something like: nebari deploy -c ... --checks none | basic | full

  • none (currently possible with --disable-checks)
  • basic (default and what we have now)
  • full (the additions you are proposing and enabled for CI / IT)

from governance.

viniciusdc avatar viniciusdc commented on June 27, 2024

I am closing this, as we already have considerations around CI integration enchantments. This RFD does not serve a direct purpose. I will summarize these points in a follow-up to the original tracking issues.

from governance.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.