Skip to content

Instantly share code, notes, and snippets.

View imshaiknasir's full-sized avatar
🎯
Being consistent

imshaiknasir

🎯
Being consistent
View GitHub Profile
# Requires -RunAsAdministrator
# This script checks for Windows Updates and installs them automatically
# Create a log file path
$logPath = "$env:USERPROFILE\Desktop\WindowsUpdateCheck.log"
$date = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
# Function to write to both console and log file
function Write-Log {
param($Message)

I'll help you create a comprehensive project structure for E2E automation testing that follows best practices and incorporates all your required technologies. Let me plan this out first.

e2e-automation/
├── .github/
│   └── workflows/
│       ├── main.yml                 # Main CI workflow
│       └── scheduled-tests.yml      # Scheduled test runs
│
├── src/
│   ├── fixtures/                    # Playwright test fixtures
@imshaiknasir
imshaiknasir / .cursorrules
Created February 8, 2025 13:37
# .cursorrules for Playwright Web/API Automation (JavaScript/TypeScript)
You are an expert in Playwright automation for both web and API testing using JavaScript and TypeScript. Your goal is to generate code that is robust, maintainable, and aligned with modern best practices in automated testing.
─────────────────────────────────────────────
1. CODE STYLE & STRUCTURE
- Write clean, idiomatic ES6+/TypeScript code with strict type safety.
- Prefer functional and declarative programming patterns; avoid unnecessary classes or boilerplate.
- Use meaningful variable and function names (e.g., isLoading, hasError, handleClick).
- Organize test code using the @playwright/test runner (use describe, test, beforeEach, afterAll) to keep tests isolated and maintainable.
- Separate page objects, utilities, and test files for clarity.
@imshaiknasir
imshaiknasir / agent.py
Created February 5, 2025 11:32
browserUse_Amazon_Demo
from langchain_google_genai import ChatGoogleGenerativeAI
from browser_use import Agent
from dotenv import load_dotenv
from pydantic import SecretStr
import asyncio
import os
load_dotenv()
async def main():
@imshaiknasir
imshaiknasir / setup_cursor_ubuntu.md
Created February 2, 2025 14:44 — forked from evgenyneu/setup_cursor_ubuntu.md
Install Cursor AI code editor on Ubuntu 24.04 LTS

Install Cursor AI editor on Ubuntu 24.04

  1. Use the Download button on www.cursor.com web site. It will download the NAME.AppImage file.

  2. Copy the .AppImage file to your Applications directory

cd ~/Downloads
mkdir -p ~/Applications
mv NAME.AppImage ~/Applications/cursor.AppImage
@imshaiknasir
imshaiknasir / Plarwright_Prompt.md
Created January 29, 2025 07:45
Prompt for Playwright Code Generation using AI

Given the following DOM structure: [DOM HTML Structure]

Generate Playwright test code in TypeScript to perform [specific action].

Here is the page URL: [URL]

Requirements:

## Study
@imshaiknasir
imshaiknasir / alllurePATH_fix.md
Created December 25, 2024 10:13
allure command is not recognized, meaning the Allure CLI is not installed or not added to the system PATH. Here’s how to resolve this issue:

Steps to Fix

  1. Install Allure CLI
    • If you haven’t already installed the Allure CLI, you need to do so. You can install it using Node.js or manually:
      • Using Node.js:
        npm install -g allure-commandline --save-dev
        This installs Allure globally and adds it to your PATH.
@imshaiknasir
imshaiknasir / PlaywrightSkeleton.md
Created December 25, 2024 10:03
Yes, Playwright provides a project skeleton or structure when you initialize a new project using the Playwright CLI. You can create and view the Playwright skeleton by following these steps:

Yes, Playwright provides a project skeleton or structure when you initialize a new project using the Playwright CLI. You can create and view the Playwright skeleton by following these steps:


1. Initialize Playwright Project

Run the following command to initialize a new Playwright project:

npx playwright init
@imshaiknasir
imshaiknasir / fixNPMintiIssue.md
Last active May 3, 2025 11:37
PowerShell blocks the `npm init playwright` command due to a restrictive execution policy, preventing the unsigned `npm.ps1` script from running. Adjust the policy temporarily using `Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass` to resolve.

Here are the steps to fix the issue persistently:

  1. Open PowerShell as Administrator:

    • Search for "PowerShell" in the Start menu.
    • Right-click it.
    • Select Run as Administrator.
  2. Check Current Execution Policy:

    • Run this command in PowerShell: Get-ExecutionPolicy -List