Skip to content

thanhloc1993/recorder-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Repo's idea

  • All js step's definitions staying ./features/step-definitions/ with squad name prefix and we will split 2 files: *-steps.ts and *-definitions.ts.

    • \*-steps.ts: declare Given/When/Then steps with instructions (see example)
    • \*-definitions.ts: define functions to working for a certain interactive
  • Scenarios staying ./features/<squad>

  • All keys/selector be declare in step-definitions/cms-selectors, step-definitions/teacher-keys and step-definitions/learner-keys

  • Sample file: ./assets

  • Download folder ./downloads will be ignore

  • Report site: https://mana-e2e.web.app/

Documentation

Steps with Instructions Example

And('teacher logins with {string} email, {string} password and {string} organization', async function(
    username: string,
    password: string
): Promise<void> {
    const teacher = this.teacher.flutterDriver!;

    await this.teacher.instruction('touch username input box, and fill the given email', async function () {
        // fillUserName can be reuse else where
        fillUserName(username)
    });

    await this.teacher.instruction('touch password input box, and fill the given password', async function () {
        fillPassword(password)
    });

    await this.teacher.instruction('press login button on middle of the screen', async function () {
        const loginButtonFinder = new ByValueKey(Keys.loginButton);
        await teacher.waitFor(loginButtonFinder);
        await teacher.tap(loginButtonFinder);
    });
})

Example of Report with Steps and Instructions

Purposes

  • Keep the BDD scripts short and clean, easier to understand but still provide enough details
  • instruction method will also take a screenshot, make the report descriptive
  • Product Manager and Partner Success can read and understand our BDD scripts

How to run eibanam

Script Setup

1. Prepare the parameters

Note these parameters to a text file, you will need them for the script later.

2. Clone the project

  • Clone this project to your local machine.
  • Your PAT can be used when git clone asks for your password.

3. Run the script

  1. Navigate to the newly cloned project eibanam
  2. Run the script. bash scripts/setup-eibanam.sh
  3. Input the noted parameters when prompted.
  4. Watch for overwrite permission prompt and errors.
  5. Edit .env.local file to run test on other branches than develop
  6. If you edited .env.local file, rerun make setup-cms and make setup-teacher-learner

Manual Setup

  1. Setup

    • Install node > 14

    • Install make command

      • Linux: sudo apt-get install build-essential
    • Install flutter

      • Flutter version: 3.3.6
      • How to downgrade:
        • cd to/your/flutter/dir
        • git checkout 3.3.6
        • Run flutter --version to check.
    • Install docker

    • Install docker-compose: sudo apt-get install docker-compose-plugin

    • Setup Github token to fetch private repo:

    • Clone the repo to your local: git clone https://github.com/manabie-com/eibanam.git

    • add .env.local file to root dir following format bellow:

      • TEACHER_FLAVOR=manabie_teacher_staging
        LEARNER_FLAVOR=manabie_learner_staging
        CMS_FLAVOR=.env.manabie.staging
        FE_REF={release-branch}
        ME_REF={release-branch}
        UNLEASH_CLIENT_KEY={client-key}
        
      • {release-branch}: get the latest release branch. e.g. release/20220713
      • {client-key}: follow 1st step of this thread to get the key.
    • make setup

    • make setup-cms

    • make setup-teacher-learner

    • make setup-docker-images

    • Use Docker experimental

  2. Run

    • Run these apps in parallel when running tests.
      • make run-cms
      • make run-teacher-web
      • make run-learner-web

When you see this message, you started cms successfully

When you see this message, you started cms successfully

  1. Run Login Test Demo or Run Test with specific tags

    • When running a test for Learner/Teacher app, you need to select PLATFORM environment (WEB, IOS, ANDROID). e.g. In your .env.local file, add:

      PLATFORM=WEB 
      
    • Run cucumber via args and options

      • Run test with specific tags: yarn cucumber --tags @lesson
      • Run a feature file: yarn cucumber features/**/*.feature
        • EX: run 1 feature yarn cucumber features/login-demo/login.feature
        • EX: run 1 scenario yarn cucumber features/login-demo/login.feature:9. :9` is line of scenario in feature file
  2. Gen report html local

    • Run
      • make report-html
        

Driver Layer

Driver layer

Manabie Context

manabie context

The purpose of a "Manabie Context" is twofold:

  • Isolate state between scenarios.
  • Share data between step definitions and hooks within a scenario:

So our architecture, A scenario contains:

  • ScenarioContext: sharing data between steps, ...
  • Platform (CMS, Learner, Teacher): interact directly to selector, ...

Run in Docker:

Note:

  • web_profile => 1 back office 1 teacher web 1 learner web
  • web_profile_112 => 1 back office 1 teacher web 2 learner web
  • mobile_profile_111 => 1 back office 1 teacher web 1 mobile web

Run:

PORT

  • CMS: 3001
  • Teacher: 3002
  • Learner: 3003

Relationship environment

scope

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages