Skip to content

Commit

Permalink
chore: fix review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
chintankavathia committed Dec 10, 2024
1 parent 6da5ba5 commit b4ff6c4
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 121 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ jobs:
with:
node-version: lts/iron

- name: Configure LFS Fetch URL
run: git config remote.origin.lfsurl https://github.com/siemens/ngx-datatable-snapshots.git/info/lfs

- name: Pull Repository with LFS
run: git lfs pull

Expand Down Expand Up @@ -55,7 +52,7 @@ jobs:

- name: E2E
run: |
npm run vrt --if-present
npm run e2e --if-present
env:
CI: true

Expand Down
2 changes: 0 additions & 2 deletions e2e-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ fi

echo "Using '$DOCKER' in '$NETWORK_MODE' mode, connecting to '$LOCAL_ADDRESS:$PORT'"

# Configure LFS URLs
npm run lfs:prepare

if [ x$1 = "xshell" ]; then
shift
Expand Down
64 changes: 0 additions & 64 deletions package-lock.json

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

7 changes: 2 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@
"ci": "run-s lint test:ci",
"lint": "ng lint",
"e2e:prepare": "playwright install",
"lfs:prepare": "git config remote.origin.lfspushurl https://github.com/siemens/ngx-datatable-snapshots.git/info/lfs && git config remote.origin.lfsurl https://github.com/siemens/ngx-datatable-snapshots.git/info/lfs",
"vrt": "cross-env playwright test",
"vrt:local": "yarn vrt",
"vrt:update": "yarn vrt --update-snapshots",
"e2e": "playwright test",
"e2e:update": "yarn e2e --update-snapshots",
"build-docs": "cross-env NODE_ENV=production ng build --configuration production --base-href=\"/ngx-datatable/\"",
"predeploy-docs": "npm run build-docs",
"deploy-docs": "angular-cli-ghpages --dir ./dist/ngx-datatable",
Expand Down Expand Up @@ -66,7 +64,6 @@
"angular-cli-ghpages": "^0.6.0",
"cpx": "^1.5.0",
"cross-env": "^7.0.2",
"dotenv-cli": "^7.4.4",
"eslint": "^9.8.0",
"eslint-plugin-jsdoc": "48.0.2",
"eslint-plugin-prefer-arrow": "^1.2.3",
Expand Down
28 changes: 0 additions & 28 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
import { defineConfig, devices } from '@playwright/test';

/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
// import dotenv from 'dotenv';
// import path from 'path';
// dotenv.config({ path: path.resolve(__dirname, '.env') });

/**
* See https://playwright.dev/docs/test-configuration.
*/
Expand Down Expand Up @@ -131,26 +123,6 @@ export default defineConfig({
name: 'chromium',
use: { ...devices['Desktop Chrome'] }
}

/* Test against mobile viewports. */
// {
// name: 'Mobile Chrome',
// use: { ...devices['Pixel 5'] },
// },
// {
// name: 'Mobile Safari',
// use: { ...devices['iPhone 12'] },
// },

/* Test against branded browsers. */
// {
// name: 'Microsoft Edge',
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
// },
// {
// name: 'Google Chrome',
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
// },
],

/* Run your local dev server before starting the tests */
Expand Down
12 changes: 6 additions & 6 deletions playwright/e2e/filter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@ import { expect, test } from '../support/test-helpers';
test.describe('table with filter', () => {
const example = 'filter';

test(example, async ({ ngx, page }) => {
await ngx.visitExample(example);
test(example, async ({ si, page }) => {
await si.visitExample(example);
await expect(page.getByText('Sarah Massey')).toBeVisible();
await ngx.runVisualAndA11yTests();
await si.runVisualAndA11yTests();

const paginator = page.locator('.datatable-pager').getByText('2');
paginator.click();
await expect(page.getByText('Sarah Massey')).not.toBeVisible();
await expect(page.getByText('Robles Boyle')).toBeVisible();
await ngx.runVisualAndA11yTests('next-page');
await si.runVisualAndA11yTests('next-page');

const filter = page.getByPlaceholder('Type to filter the name column...');
filter.clear();
filter.pressSequentially('Wong Craft');
await expect(page.getByText('1 total')).toBeVisible();
await ngx.runVisualAndA11yTests('filtered');
await si.runVisualAndA11yTests('filtered');

filter.clear();
filter.pressSequentially('Some random text');
await expect(page.getByText('No data to display')).toBeVisible();
await ngx.runVisualAndA11yTests('empty');
await si.runVisualAndA11yTests('empty');
});
});
16 changes: 8 additions & 8 deletions playwright/e2e/row-group.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { expect, test } from '../support/test-helpers';
test.describe('row grouping', () => {
const example = 'row-grouping';

test(example, async ({ ngx, page }) => {
await ngx.visitExample(example);
test(example, async ({ si, page }) => {
await si.visitExample(example);

await expect(page.getByText('Ethel Price')).toBeVisible();
await ngx.runVisualAndA11yTests('default', [
await si.runVisualAndA11yTests('default', [
// interactive elements< (<a/>, <input/> etc) within table cells are failing
{
id: 'aria-required-children',
Expand All @@ -25,7 +25,7 @@ test.describe('row grouping', () => {

await expect(page.getByText('4 selected')).toBeVisible();

await ngx.runVisualAndA11yTests('group-selected', [
await si.runVisualAndA11yTests('group-selected', [
{
id: 'aria-required-children',
enabled: false
Expand All @@ -37,14 +37,14 @@ test.describe('row grouping', () => {
]);
});

test(example + ' expand/collapse', async ({ ngx, page }) => {
await ngx.visitExample(example);
test(example + ' expand/collapse', async ({ si, page }) => {
await si.visitExample(example);

await expect(page.getByText('Ethel Price')).toBeVisible();
const groupHeader = page.getByTitle('Expand/Collapse Group').first();
groupHeader.click();
await expect(page.getByText('Ethel Price')).not.toBeVisible();
await ngx.runVisualAndA11yTests('group-collapsed', [
await si.runVisualAndA11yTests('group-collapsed', [
{
id: 'aria-required-children',
enabled: false
Expand All @@ -56,7 +56,7 @@ test.describe('row grouping', () => {
]);
groupHeader.click();
await expect(page.getByText('Ethel Price')).toBeVisible();
await ngx.runVisualAndA11yTests('group-expanded', [
await si.runVisualAndA11yTests('group-expanded', [
{
id: 'aria-required-children',
enabled: false
Expand Down
8 changes: 4 additions & 4 deletions playwright/support/test-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export type StaticTestOptions = {
skipAutoScaleViewport?: boolean;
};

class NgxTestHelpers {
class SiTestHelpers {
private disableAnimationsTag: ElementHandle<Node> | undefined;

constructor(
Expand Down Expand Up @@ -216,11 +216,11 @@ class NgxTestHelpers {
}

export const test = baseTest.extend<{
ngx: NgxTestHelpers;
si: SiTestHelpers;
}>({
ngx: [
si: [
async ({ page }, use, testInfo) => {
await use(new NgxTestHelpers(page, testInfo));
await use(new SiTestHelpers(page, testInfo));
},
{ box: true }
]
Expand Down

0 comments on commit b4ff6c4

Please sign in to comment.