Skip to content

Commit

Permalink
implemented selenium
Browse files Browse the repository at this point in the history
  • Loading branch information
MiguelPelegrina committed Apr 29, 2024
1 parent e52293d commit 2ce4a1a
Show file tree
Hide file tree
Showing 4 changed files with 134 additions and 16 deletions.
14 changes: 14 additions & 0 deletions e2e/test-catalog-load.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const {Builder, until} = require("selenium-webdriver")

async function checkCatalogPage(){
let driver = await new Builder().forBrowser("chrome").build();

try{
await driver.get('http://localhost:4200');
await driver.wait(until.titleIs('Online Bookstore'), 10000)
} finally{
await driver.quit()
}
}

checkCatalogPage()
126 changes: 114 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"ngx-mask": "^16.3.9",
"ngx-permissions": "^16.0.1",
"rxjs": "~7.8.0",
"selenium-webdriver": "^4.20.0",
"sweetalert2": "^11.10.7",
"tslib": "^2.3.0",
"uuid": "^9.0.1",
Expand All @@ -39,6 +40,7 @@
"@angular/cli": "~16.0.1",
"@angular/compiler-cli": "^16.0.0",
"@types/jasmine": "~4.3.0",
"@types/selenium-webdriver": "^4.1.22",
"@types/uuid": "^9.0.8",
"jasmine-core": "~4.6.0",
"karma": "~6.4.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core';
import { AfterViewInit, Component, ViewChild } from '@angular/core';
import * as XLSX from 'xlsx';
import { allowedParserExtensions, requiredFileType } from 'src/app/shared/utils/required-file-type';
import Swal from 'sweetalert2';
Expand All @@ -7,7 +7,7 @@ import { Book } from 'src/app/shared/domain/book/book';
import { ExcelBook } from 'src/app/shared/domain/book/excel-book/excel-book';
import { capitalizeFirstLetter, informUserOfError } from 'src/app/shared/utils/utils';
import { MatTableDataSource } from '@angular/material/table';
import { MatPaginator, PageEvent } from '@angular/material/paginator';
import { MatPaginator } from '@angular/material/paginator';
import { StringValues } from 'src/app/shared/utils/string-values';

/**
Expand Down Expand Up @@ -51,7 +51,7 @@ export class BookExcelParserComponent implements AfterViewInit{
* @param {BookService} service - The BookService for handling book-related operations.
*/
constructor(private service: BookService){}

ngAfterViewInit(): void {
this.dataSource.paginator = this.paginator;

Expand All @@ -61,7 +61,7 @@ export class BookExcelParserComponent implements AfterViewInit{
this.dataPageSize = event.pageSize;
});
}

// Methods
// Protected methods
/**
Expand Down

0 comments on commit 2ce4a1a

Please sign in to comment.