how to check a radio button or checkbox in Playwright?

// https://playwright.dev/docs/api/class-locator#locator-check
// await radioButton.check();
  test("Radio button actions", async ({ page }) => {
    await page.goto("https://testautomationpractice.blogspot.com/");
    const radioButton = page.getByRole("radio").and(page.locator("#male"));
    await radioButton.check();
    await expect(radioButton).toBeChecked();
  });

How to check if a radio button or checkbox is checked in Playright?

// https://playwright.dev/docs/api/class-locatorassertions#locator-assertions-to-be-checked
// expect(radioButton).toBeChecked();
  test("Radio button actions", async ({ page }) => {
    await page.goto("https://testautomationpractice.blogspot.com/");
    const radioButton = page.getByRole("radio").and(page.locator("#male"));
    await radioButton.check();
    await expect(radioButton).toBeChecked();
  });

BH1750_setup

#include <Arduino.h>
#include <hp_BH1750.h>
#include <Wire.h>

//I2C communcation
#define SDA 8
#define SCL 9

// Add this to .ini file: monitor_speed = 115200

hp_BH1750 bh1750;
//BH1750Quality bh1759_q = BH1750_QUALITY_HIGH; // I don't think is used anywhere

void setup() {
  Serial.begin(115200);
  Wire.begin(SDA, SCL); // Initialize I2C with defined pins
  delay(1000);
  Serial.println("Starting BH1750 sensor initialization...");

  bh1750.begin(BH1750_TO_GROUND); // 0x23

1

Install the opencode-antigravity-auth plugin and add the Antigravity model definitions to ~/.config/opencode/opencode.json by following: https://raw.githubusercontent.com/NoeFabris/opencode-antigravity-auth/dev/README.md

Use CTE (Common Table Expression)


ALTER PROCEDURE [dbo].[GetPOBasicParentDataByParamsForAdvanceBill_SP]
@FromDate date,
@ToDate date,
@POId int = 2011,
@SupplierId int=0,
@CompanyId int=0,
@userId int = 3
AS
	;WITH AlreadyBilledAmount AS (
	SELECT 
		bic.Po_Id,
		SUM(ISNULL(bigc.billAmount,0.00)) - SUM(ISNULL(bigc.Discount,0.00)) as TotalBilledAmount
		FROM dbo.BillInvoice_Parent bip
		INNER JOIN dbo.BillInvoice_Child bic ON bip.ID = bic.Bill_ParentId
		INNER JOIN dbo.BillInvoice_GrandChild bigc ON bigc.Bill_Pare

Python Packaging - One Big Question

# Pourquoi les imports nécessitent une install éditable avec un src layout

## Le problème

Quand tu lances `pytest` depuis la racine du projet, Python cherche les modules dans son `sys.path`. Par défaut, `sys.path` contient le répertoire courant (`.`) et les packages installés. Avec ta structure :

```text
.
├── src/
│   └── mini_etl/
│       ├── __init__.py
│       └── models.py
├── tests/
│   └── test_models.py
```

Python ne trouve pas `mini_etl` parce qu'il n'est **ni à la racine** (il est 

How to select a element by role and also for css selector in Playwright?

// It is possible using .and locator https://playwright.dev/docs/api/class-locator#locator-and
import { test, expect } from "@playwright/test";

test(" Text input actions", async ({ page }) => {
  await page.goto("https://testautomationpractice.blogspot.com/");
  const textBox = page.getByRole('textbox').and(page.locator("#name"));
  await textBox.fill("Playwright");
  await expect(textBox).toHaveValue("Playwright");
});

how to runs only one test on PlayWright?


npx playwright test tests/todo-page.spec.ts

how to check if a input has a value using Playwright?

// https://playwright.dev/docs/api/class-locatorassertions#locator-assertions-to-have-value
const locator = page.locator('input[type=number]');
await expect(locator).toHaveValue(/[0-9]/);

how to complete a input or text area in playwirght?

// Text input
await page.getByRole('textbox').fill('Peter');

// All arguments https://playwright.dev/docs/api/class-locator#locator-fill

190. Reverse Bits

Reverse bits of a given 32 bits signed integer.
/**
 * @param {number} n
 * @return {number}
 */
var reverseBits = function(n) {
    // This will accumulate the reversed bit pattern.
    // Start at 0 because we build it up bit-by-bit.
    let result = 0;

    // We must process exactly 32 bits.
    for (let i = 0; i < 32; i++) {

        // Step 1: Extract the least significant bit (LSB) of n.
        // (n & 1) gives us either 0 or 1.
        let bit = n & 1;

        // Step 2: Shift result left to make room for the new bit.
        result

AI ML

# AI / ML

## Prompt

Openness to experience, Conscientiousness, Extraversion, Agreeableness, Non-Neuroticism. (https://github.com/aimclub/OCEANAI?tab=readme-ov-file)


- AIM
- OCEAN
- CoT

## Context

- `.github/prompts/*.prompt.md` - default in VSCode (change: `chat.promptFilesLocations`) https://code.visualstudio.com/docs/copilot/customization/prompt-files
- `@...`
- Structured Output

how to test if a element is enabled on page using Playwright?

// you can do that using the toBeEnabled method of the object that returns expect method
 
import { test, expect } from '@playwright/test';
 
test('basic test', async ({ page }) => {
  await page.goto('https://playwright.dev/');
  const inputName = page.locator("#name") // Select element by id
  await expect(inputName).toBeEnabled()
});

how to check if a element is visible on a page using PlayWright?

// you can do that using the toBeVisible method of the object that returns expect method
 
import { test, expect } from '@playwright/test';
 
test('basic test', async ({ page }) => {
  await page.goto('https://playwright.dev/');
  const inputName = page.locator("#name") // Select element by id
  await expect(inputName).toBeVisible()
});

how to select an html element using css selector in Playwright?

// you can do that using the locator method of the page object that is set as argument of the test function argument

import { test, expect } from '@playwright/test';

test('basic test', async ({ page }) => {
  await page.goto('https://playwright.dev/');
  const inputName = page.locator("#name") // Select element by id
  await expect(inputName).toBeVisible()
});

Prevent to push on branches

- Create `.git/hooks/pre-push` with ``` #!/bin/bash protected_branches=("develop" "main" "master" "prodcution") current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,') for branch in "${protected_branches[@]}"; do if [ "$current_branch" = "$branch" ]; then echo "🚫 Direct push to '$branch' is not allowed." echo " Please create a feature branch and open a pull request." exit 1 fi done exit 0 ``` - Then make it executable with `chmod +x .git/hooks/pre-push`
#!/bin/bash

protected_branches=("develop" "main" "master" "production")
current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')

for branch in "${protected_branches[@]}"; do
    if [ "$current_branch" = "$branch" ]; then
        echo "🚫 Direct push to '$branch' is not allowed."
        echo "   Please create a feature branch and open a pull request."
        exit 1
    fi
done

exit 0