Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
5b92ab8
Add Appium E2E tests in automatic-e2e-tests folder
HershelT Jul 14, 2025
138ecfb
fix: comments for browserstacks-test-android github actions workflow.…
HershelT Jul 14, 2025
24435cd
feat: enhance E2E testing framework with new constants, cleanup scrip…
HershelT Jul 16, 2025
60b0f5c
feat: add cleanup instructions to ReadMe, refactor text utility funct…
HershelT Jul 16, 2025
99731e2
feat (Top[ics page test): Created topics page component to help navia…
HershelT Jul 16, 2025
f549e9f
feat: cleaning up files, getting file names and .md files ready for p…
HershelT Jul 17, 2025
514860f
Working on description for each utils file and creating seperate .md…
HershelT Jul 17, 2025
8539a2e
Feat:
HershelT Jul 17, 2025
cd3e685
feat: seperated logging declarations to test_init.ts for seperation o…
HershelT Jul 17, 2025
1a16345
Edit documentation (.md files) to address and satisfy PR review comme…
HershelT Jul 20, 2025
b689cd4
docs(.md): clarify that components/ structure aligns with the Page Ob…
HershelT Jul 20, 2025
04e8a77
chore: looking closer at .md files to ensure better understanding. Fi…
HershelT Jul 21, 2025
9b27826
Refactor testing framework constants and utilities for improved maint…
HershelT Jul 22, 2025
93339c2
Refactor error handling and logging in testing framework
HershelT Jul 22, 2025
481e121
refactor: consolidate imports from constants for improved readability…
HershelT Jul 22, 2025
49f3ee3
refactor: introduce NAVBAR_SELECTORS for improved navigation item man…
HershelT Jul 22, 2025
30b5a54
refactor: rename UI color checking functions for improved clarity and…
HershelT Jul 22, 2025
2c5932e
refactor: streamline error handling in selectFromList function and en…
HershelT Jul 22, 2025
04f3828
refactor: update function signatures to throw errors instead of retur…
HershelT Jul 23, 2025
d0888d5
refactor: rename error_constants.ts to errors.ts and browserstackUtil…
HershelT Jul 23, 2025
8f88832
chore: Removed hardcoded wait times and selectors. Updates TEST_GUIDE…
HershelT Jul 23, 2025
3b3ce67
refactor: update color thresholds and swipe configurations (e.g. swip…
HershelT Jul 23, 2025
5ae2224
chore: enhanced setup to prevent loading apk and testing it errors
HershelT Jul 24, 2025
b9b69f2
feat: Add cross-platform iOS/Android support to testing framework
HershelT Jul 29, 2025
ab9d9ad
refractor: Continued to hammer away at making the selectors for iOS w…
HershelT Jul 30, 2025
2ef317f
Feat: Updated .md files to reflect the complete overhaul of the testi…
HershelT Jul 31, 2025
5baa52c
removing .only
HershelT Jul 31, 2025
6a705b0
Removing SETUP_NOVICE. Reason: Not needed anymore after updated setup…
HershelT Jul 31, 2025
b74d4c6
updating example.env
HershelT Jul 31, 2025
ee247ce
chore: Update .gitignore paths and clean up example.env files for iOS…
HershelT Aug 4, 2025
1d426e1
Refactor: Update .gitignore and streamline selectors for Topics page;…
HershelT Aug 4, 2025
0852587
Refactor E2E utils and components export and import.
HershelT Aug 4, 2025
d3c8940
chore: Moved .env file to root, and allowed dynamic selection of .env…
HershelT Aug 4, 2025
6702b42
refractor file names to align with naming conventions
HershelT Aug 5, 2025
f682f39
Refactor: Update iOS selectors for Topics page and enhance text const…
HershelT Aug 5, 2025
c2f894b
Added another check to see if we are on sheets page, and not source page
HershelT Aug 5, 2025
313d063
fix: update selectors for three dots menu in topics page tests
HershelT Aug 6, 2025
bfc757e
feat: Enhance E2E testing framework with parallel execution and devic…
HershelT Aug 6, 2025
e84cfe2
fix: Update iPhone 13 Pro device details and improve environment vari…
HershelT Aug 6, 2025
78c6878
First batch of PR Comments
HershelT Aug 10, 2025
3d9f407
feat: reviewing PR comments. Refactor BrowserStack CI/CD test workflo…
HershelT Aug 10, 2025
a5b4b38
Feat: Removed merge conflict in .gitignore and almost went through al…
HershelT Aug 11, 2025
aeba1f6
refractor: Refractored the shared folder to remove it and place the s…
HershelT Aug 11, 2025
c2660d0
Removing .only
HershelT Aug 11, 2025
726a455
Removing [INFO] from .log - not needed
HershelT Aug 12, 2025
a49a991
feat: Enhance swipeIntoView function to support partial text matching…
HershelT Aug 12, 2025
d3de7c0
refractor: Updating file paths to reflect our newish structure
HershelT Aug 12, 2025
a85f3b3
refactor: Update file roles and descriptions for various components t…
HershelT Aug 13, 2025
0d866fe
refractor: working on enhancing erros and return values of POM Compon…
HershelT Aug 13, 2025
e961bc4
Refactor utility imports and constants for improved consistency and c…
HershelT Aug 14, 2025
7c00fef
refactor: Update component functions to return boolean for success in…
HershelT Aug 14, 2025
04fa999
refactor: Adjust swipe configuration for TEXT_SCROLL_DISTANCE and enh…
HershelT Sep 1, 2025
c79a82b
refactor: Rename e2e.spec.ts to regression.spec.ts and update referen…
HershelT Sep 1, 2025
8cc364f
feat: Starting work on creating sanity checks
HershelT Sep 1, 2025
952591e
feat: Finished up the sanity checks (maybe refine it a little more). …
HershelT Sep 4, 2025
f05178d
refactor: fixing up all the sanity tests. Enhance error handling in h…
HershelT Sep 7, 2025
0d0fa2b
feat: working on increasing test speed and redliability. Made it all …
HershelT Sep 8, 2025
1bd2c0c
feat: enhance popup handling with continuous monitoring and improved …
HershelT Sep 9, 2025
9005898
chore: fixing up some text and missing colons.
HershelT Sep 9, 2025
b23d3f2
chore: cleaning up lack of colons and unsued imports
HershelT Sep 10, 2025
c8313e1
chore: moved around screenshot capture to ui_checker.ts to align with…
HershelT Sep 10, 2025
880f968
chore: some tweaks and notes from pre Review from Daniel
HershelT Sep 10, 2025
e9d5613
refractor: Fixed up global popUp Monitor to increase efficiency and s…
HershelT Sep 11, 2025
528237a
refactor: Update popup handling and test setup for improved efficienc…
HershelT Sep 11, 2025
f05be63
feat: Moving around hard coded steps and attaching them to functions.…
HershelT Sep 11, 2025
333bd51
feat: Refining backgroun popup monitor to close pop up quickly.
HershelT Sep 14, 2025
990cb47
chore: fixing up closePopUp to consolidate it from two functions to o…
HershelT Sep 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/android-browserstack-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Run Android BrowserStack Tests

on:
workflow_dispatch:
inputs:
platform:
description: 'Platform to test'
required: true
default: 'android'
type: choice
options:
- android

jobs:
run-android-tests:
runs-on: ubuntu-latest
name: Android Tests

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'

- name: Navigate to test directory
run: cd automatic-e2e-tests

- name: Clean npm cache
working-directory: automatic-e2e-tests
run: npm cache clean --force

- name: Clean up logs and screenshots
working-directory: automatic-e2e-tests
run: |
npm run cleanup:android

- name: Install Dependencies
working-directory: automatic-e2e-tests
run: npm install

- name: Run Android Tests on BrowserStack
working-directory: automatic-e2e-tests
env:
PLATFORM: android
RUN_ENV: browserstack
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
ANDROID_BROWSERSTACK_APP_ID: ${{ secrets.ANDROID_BROWSERSTACK_APP_ID }}
GITHUB_ACTIONS: true
run: npm run test:android:browserstack

- name: Upload Android test logs
if: always()
uses: actions/upload-artifact@v4
with:
name: android-logs
path: automatic-e2e-tests/logs/android/
if-no-files-found: warn

- name: Upload Android screenshots if tests fail
if: failure()
uses: actions/upload-artifact@v4
with:
name: android-screenshots
path: automatic-e2e-tests/screenshots/android/
if-no-files-found: ignore
69 changes: 69 additions & 0 deletions .github/workflows/ios-browserstack-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Run iOS BrowserStack Tests

on:
workflow_dispatch:
inputs:
platform:
description: 'Platform to test'
required: true
default: 'ios'
type: choice
options:
- ios

jobs:
run-ios-tests:
runs-on: ubuntu-latest
name: iOS Tests

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'

- name: Navigate to test directory
run: cd automatic-e2e-tests

- name: Clean npm cache
working-directory: automatic-e2e-tests
run: npm cache clean --force

- name: Clean up logs and screenshots
working-directory: automatic-e2e-tests
run: |
npm run cleanup:ios

- name: Install Dependencies
working-directory: automatic-e2e-tests
run: npm install

- name: Run iOS Tests on BrowserStack
working-directory: automatic-e2e-tests
env:
PLATFORM: ios
RUN_ENV: browserstack
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
IOS_BROWSERSTACK_APP_ID: ${{ secrets.IOS_BROWSERSTACK_APP_ID }}
GITHUB_ACTIONS: true
run: npm run test:ios:browserstack

- name: Upload iOS test logs
if: always()
uses: actions/upload-artifact@v4
with:
name: ios-logs
path: automatic-e2e-tests/logs/ios/
if-no-files-found: warn

- name: Upload iOS screenshots if tests fail
if: failure()
uses: actions/upload-artifact@v4
with:
name: ios-screenshots
path: automatic-e2e-tests/screenshots/ios/
if-no-files-found: ignore
29 changes: 29 additions & 0 deletions automatic-e2e-tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Node modules
node_modules/

# Environment variables
.env
.env.*
.secrets


# Build output
.dist/
dist/
build/
out/


# logs and screenshots
screenshots/ios/*
screenshots/android/*
logs/android/*
logs/ios/*

# IDE files
.vscode/

# APK, AAB, and IPA
*.apk
*.aab
*.ipa
11 changes: 11 additions & 0 deletions automatic-e2e-tests/.mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"require": ["ts-node/register"],
"loader": "ts-node/esm",
"extensions": ["ts"],
"timeout": 300000,
"exit": true,
"recursive": true,
"reporter": "spec",
"spec": ["tests/**/*.spec.ts", "!tests/**/sanity.spec.ts"],
"ui": "bdd"
}
11 changes: 11 additions & 0 deletions automatic-e2e-tests/.mocharc.sanity.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"require": ["ts-node/register"],
"loader": "ts-node/esm",
"extensions": ["ts"],
"timeout": 300000,
"exit": true,
"recursive": false,
"reporter": "spec",
"spec": "tests/sanity.spec.ts",
"ui": "bdd"
}
137 changes: 137 additions & 0 deletions automatic-e2e-tests/FILE_OVERVIEW.md

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't let the many small comments confuse you. This is a good file

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have a naming difference in between different MD files.
Note, generally there are some naming convention mixups. Could you ask AI to review that for you?

Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
# Sefaria Mobile Testing Framework - File Overview

This document describes the purpose and main usage of each file and folder in the E2E test directory.
Use this as a quick reference for contributors and maintainers.

---

## Directory Structure

- **Selectors/**
Contains platform-specific selectors for Android and iOS.
- **selectors/android/selectors.ts**
Android-specific UI selectors and XPath patterns.
- **selectors/ios/selectors.ts**
iOS-specific UI selectors and XPath patterns.

- **logs/** and **screenshots/**
Centralized logs and screenshots for both platforms.

- **scripts/**
Utility scripts (e.g., cleanup.js). `run-parallel-tests.js` for running tests in parallel on multiple devices.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You give two examples. But one is in brackets and one isn't.
I'd would unify the format here


- **devices.json**
Configuration file for devices used in parallel testing. Set specific devices and version for Android and iOS.

---

## components/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confusing styling.
Some dirs are h2 and some are bold.
Also, I'd order the dirs by importance


> **Note:** The files in this directory follow the Page Object Model (POM) pattern, where each file represents a specific page or component of the app.

Reusable page/component objects for high-level UI actions (cross-platform).

- **display_settings.ts**
Helpers for toggling display settings and language.

- **navbar.ts**
Functions to interact with the navigation bar.

- **reader_page.ts**
Utilities for validating titles and text on the reader page.

- **search_page.ts**
Helpers for typing into the search bar and selecting from search results.

- **topics_page.ts**
Functions for navigating and validating the Topics page.

- **index.ts**
Central import point for all components, allowing easy access to all page objects.

- **\*.ts**
Add new component helpers as needed.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what this is.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to make it represent a wild card, like add more later!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh I think it's understood implicitly


---

## constants/

Centralized constants for timeouts, gestures, colors, errors, and text.

- **timeouts.ts**
All timeout values organized by operation type.

- **gestures.ts**
Gesture configuration for swipes, scrolls, etc. Used for user interaction simulations.

- **colors.ts**
Sefaria brand colors and color thresholds.

- **errors.ts**
Error message templates and logging helpers.

- **text_constants.ts**
Text snippets, Hebrew months, and other static text.

- **index.ts**
Central import point for all constants, with dynamic platform selector loading.
This file **automatically loads the correct selectors** at runtime based on the current platform (Android or iOS), so you can always import `Selectors` from `constants` and it will "just work".

---

## tests/

Where your actual test suites live.

- **regression.spec.ts**
Main end-to-end regression test suite. Used for full app validation.

- **sanity.spec.ts**
Quick sanity checks to verify basic app functionality. Runs faster than full regression. Used for quick validation.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe mention why/how it runs faster


- **\*.spec.ts**
Add new test files for specific features or components.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here too, I don't think this line is needed


---

## utils/

Helper modules for low-level actions, API calls, and cross-cutting concerns.

- **browserstack_report.ts**
Helpers for interacting with the BrowserStack session API (set session status, report results).

- **gesture.ts**
Gesture and scrolling utilities: swipe, scroll, and element search with screen dimension caching.

- **helper_functions.ts**
General-purpose helpers: text escaping, color conversion, date formatting, and assertion helpers.

- **load_credentials.ts**
Loads environment variables and credentials from `.env` file in the root directory of `automatic-e2e-tests/`.

- **PopUps.ts**
Handles the initial offline popup in the app.

- **sefariaAPI.ts**
Fetches and caches data from the Sefaria API.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You change the naming convention in popups and sefariaApi

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, this could potentially be a POM.
Likely not, but if you test the API then maybe it should be


- **text_finder.ts**
Locates and interacts with text and elements by text or content-desc, and more. **Important:** Used all across tests and functions.

- **ui_checker.ts**
Checks pixel colors of UI elements and viewgroups.

- **index.ts**
Central import point for all utilities.

- **\*.ts**
Add new utility functions as needed.

---

_Last updated: July 2025_

---

[⬅ README](./README.md)
Loading