Skip to content

Commit

Permalink
remove unrelated changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ANKUR DWIVEDI authored and ANKUR DWIVEDI committed Nov 24, 2023
1 parent e956faf commit c21b82c
Show file tree
Hide file tree
Showing 7 changed files with 15,151 additions and 21,548 deletions.
41 changes: 13 additions & 28 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,35 +74,20 @@ jobs:
npm install
- name: Start the app for Cypress
timeout-minutes: 5
run: |
npm run start:test-app -- --host 0.0.0.0 > /dev/null 2>&1 &
npm run start:test-app > /dev/null 2>&1 &
echo "App started successfully"
npx wait-on http://localhost:3000
echo "App is ready"
- name: Check the app for Cypress
timeout-minutes: 5
run: |
lsof -i :3000
lsof -i :3001
# - name: Start ngrok with NGROK_OPTS
# run: npx ngrok http 3000 --authtoken 2Yat3ngA9XGNXZygaTiJxMOCm4F_2g5N7pXAyUaN5QnswEULN --inspect=false --log=stdout --host-header="localhost:3000" --domain=blessed-monthly-mongoose.ngrok-free.app
# env:
# NGROK_OPTS: "--ngrok-args=--skip-browser-update"

- name: Run Cypress tests
run: npx cypress run --headed --browser chrome

# - name: Start the app and run E2E tests
# uses: cypress-io/github-action@v4
# with:
# wait-on: https://blessed-monthly-mongoose.ngrok-free.app
# env:
# DEBUG: 'cypress:server:browsers:electron'
# CI: true
# VUE_APP_PUBLIC_KEY: ${{ secrets.ik_public_key }}
# VUE_APP_PRIVATE_KEY: ${{ secrets.ik_private_key }}
# VUE_APP_URL_ENDPOINT: ${{ secrets.ik_url_endpoint }}
# VUE_APP_AUTHENTICATION_ENDPOINT: http://localhost:3001/auth
- name: Start the app and run E2E tests
uses: cypress-io/github-action@v4
with:
wait-on: http://localhost:3000
env:
DEBUG: 'cypress:server:browsers:electron'
CI: true
VUE_APP_PUBLIC_KEY: ${{ secrets.ik_public_key }}
VUE_APP_PRIVATE_KEY: ${{ secrets.ik_private_key }}
VUE_APP_URL_ENDPOINT: ${{ secrets.ik_url_endpoint }}
VUE_APP_AUTHENTICATION_ENDPOINT: http://localhost:3001/auth
36 changes: 6 additions & 30 deletions cypress/e2e/IKImage.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,12 @@ describe('ImageKit Vue SDK', () => {
const APP_HOST = Cypress.env().APP_HOST;
describe('Lazyload', () => {
it('should have empty src before reaching lazyload threshold', () => {
cy.intercept('GET', '**/*', (req) => {
// Set the custom header
req.headers['ngrok-skip-browser-warning'] = 'true';
});
cy.visit(APP_HOST, { timeout: 30000 });
cy.visit(APP_HOST);
cy.get('.lazyload').should('have.attr', 'src').and('equal', '');
});

it('should have actual src after reaching lazyload threshold', () => {
cy.intercept('GET', '**/*', (req) => {
// Set the custom header
req.headers['ngrok-skip-browser-warning'] = 'true';
});
cy.visit(APP_HOST, { timeout: 30000 });
cy.visit(APP_HOST);
cy.get('.lazyload').scrollIntoView();

cy.wait(500);
Expand All @@ -28,22 +20,14 @@ describe('ImageKit Vue SDK', () => {

describe('Lazyload with LQIP', () => {
it('should have lqip src before reaching threshold', () => {
cy.intercept('GET', '**/*', (req) => {
// Set the custom header
req.headers['ngrok-skip-browser-warning'] = 'true';
});
cy.visit(APP_HOST, { timeout: 30000 });
cy.visit(APP_HOST);
cy.get('.lazyload-lqip')
.should('have.attr', 'src')
.and('include', 'tr:h-200,w-200:q-20,bl-30/default-image.jpg');
});

it('should have actual src after reaching element', () => {
cy.intercept('GET', '**/*', (req) => {
// Set the custom header
req.headers['ngrok-skip-browser-warning'] = 'true';
});
cy.visit(APP_HOST, { timeout: 30000 });
cy.visit(APP_HOST);
cy.get('.lazyload-lqip').scrollIntoView();

cy.wait(1000);
Expand All @@ -57,22 +41,14 @@ describe('ImageKit Vue SDK', () => {
describe('LQIP', () => {
// unable to test this because actual image load always finishes too quickly
it.skip('should have lqip src before image is loaded', () => {
cy.intercept('GET', '**/*', (req) => {
// Set the custom header
req.headers['ngrok-skip-browser-warning'] = 'true';
});
cy.visit(APP_HOST, { timeout: 30000 });
cy.visit(APP_HOST);
cy.get('.lqip')
.should('have.attr', 'src')
.and('include', 'tr:h-200,w-200:q-20,bl-30/default-image.jpg');
});

it('should have actual src after image is loaded', () => {
cy.intercept('GET', '**/*', (req) => {
// Set the custom header
req.headers['ngrok-skip-browser-warning'] = 'true';
});
cy.visit(APP_HOST, { timeout: 30000 });
cy.visit(APP_HOST);
cy.get('.lqip').scrollIntoView();

cy.wait(500);
Expand Down
6 changes: 1 addition & 5 deletions cypress/e2e/IKUpload.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@ describe('ik-upload component', () => {

describe('Image Upload', () => {
it('should upload image and render same image', () => {
cy.intercept('GET', '**/*', (req) => {
// Set the custom header
req.headers['ngrok-skip-browser-warning'] = 'true';
});
// launch URL
cy.visit(APP_HOST, { timeout: 30000 });
cy.visit(APP_HOST);

//static file
const p = 'sample.jpeg'
Expand Down
6 changes: 1 addition & 5 deletions cypress/e2e/IKVideo.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@ describe('IKVideo Element', () => {

describe('Advance transformation', () => {
it('should have element with advance transformation', () => {
cy.intercept('GET', '**/*', (req) => {
// Set the custom header
req.headers['ngrok-skip-browser-warning'] = 'true';
});
cy.visit(APP_HOST, { timeout: 30000 });
cy.visit(APP_HOST);

cy.get('.ikvideo-with-tr').scrollIntoView();

Expand Down
Loading

0 comments on commit c21b82c

Please sign in to comment.