Skip to content

Commit 03a0ea8

Browse files
authored
Clean up deployment implementation (#71)
* Clean up deployment implementation * clean monaco base url * add delay to each request in e2e test * increate time out
1 parent d6a95d7 commit 03a0ea8

File tree

11 files changed

+15
-22
lines changed

11 files changed

+15
-22
lines changed

cypress.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const config: any = {
66
videosFolder: 'cypress/videos',
77
downloadsFolder: 'cypress/downloads',
88
baseUrl: 'https://text-compare.netlify.app',
9+
pageLoadTimeout: 120000, // 2 minutes
910
setupNodeEvents(on, cfg) {
1011
// keep default behavior; add plugins here if needed
1112
return cfg;

cypress/integration/home.cy.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
/// <reference types="cypress" />
22

33
describe('Text Compare App', () => {
4+
const delay = 1000; // 1 second
5+
46
beforeEach(() => {
5-
cy.visit('https://text-compare.netlify.app/');
7+
cy.visit('/');
8+
cy.wait(delay); // wait 1 second before running each test
69
});
710

811
it('should display the app name on the home page', () => {
9-
cy.visit('/');
1012
cy.contains('Text Compare');
1113
cy.contains('Netlify');
1214
cy.get('h1').should('contain.text', 'Text Compare');
1315
});
1416

1517
it('should display two text boxes and a compare button', () => {
16-
cy.visit('/');
1718
cy.get('#editor1').should('be.visible');
1819
cy.get('#editor2').should('be.visible');
1920
cy.contains('button', 'Compare').should('be.visible');
@@ -23,8 +24,8 @@ describe('Text Compare App', () => {
2324
const left = 'Hello World';
2425
const right = 'Hello world';
2526

26-
cy.get('#editor1').clear().type(left);
27-
cy.get('#editor2').clear().type(right);
27+
cy.get('#editor1').clear().type(left, { delay: 200 }); // 200ms between keystrokes
28+
cy.get('#editor2').clear().type(right, { delay: 200 });
2829

2930
cy.contains('button', 'Compare').click();
3031
cy.get('#diffeditor').should('be.visible');

src/app/app.module.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { BrowserModule } from '@angular/platform-browser';
22
import { NgModule } from '@angular/core';
3-
import { APP_BASE_HREF } from '@angular/common';
43

54
import { AppComponent } from './app.component';
65
import { HomeComponent } from './home/home.component';
@@ -31,7 +30,7 @@ import { environment } from '../environments/environment';
3130
baseUrl: environment.monacoBaseUrl
3231
})
3332
],
34-
providers: [{ provide: APP_BASE_HREF, useValue: environment.baseHref }],
33+
providers: [],
3534
bootstrap: [AppComponent]
3635
})
3736
export class AppModule {}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
export const environment = {
22
production: true,
33
envName: 'Azure',
4-
baseHref: '/',
5-
monacoBaseUrl: '/assets/monaco/min/vs'
4+
monacoBaseUrl: ''
65
};
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
export const environment = {
22
production: true,
33
envName: 'Nas',
4-
baseHref: '/',
5-
monacoBaseUrl: '/assets/monaco/min/vs'
4+
monacoBaseUrl: ''
65
};
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
export const environment = {
22
production: true,
33
envName: 'Netlify',
4-
baseHref: '/',
5-
monacoBaseUrl: '/assets/monaco/min/vs'
4+
monacoBaseUrl: ''
65
};
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
export const environment = {
22
production: true,
33
envName: 'GitHub Pages',
4-
baseHref: '/text-compare-angular/',
5-
monacoBaseUrl: '/assets/monaco/min/vs'
4+
monacoBaseUrl: ''
65
};
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
export const environment = {
22
production: true,
33
envName: 'GitHub Pages',
4-
baseHref: '/',
54
monacoBaseUrl: '/text-compare-angular/assets/monaco/min/vs'
65
};
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
export const environment = {
22
production: true,
33
envName: 'Production',
4-
baseHref: '/',
5-
monacoBaseUrl: '/assets/monaco/min/vs'
4+
monacoBaseUrl: ''
65
};
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
export const environment = {
22
production: true,
33
envName: 'Render',
4-
baseHref: '/',
5-
monacoBaseUrl: '/assets/monaco/min/vs'
4+
monacoBaseUrl: ''
65
};

0 commit comments

Comments
 (0)