Skip to content
1 change: 1 addition & 0 deletions angular-app
Submodule angular-app added at bda100
12 changes: 12 additions & 0 deletions create-new-post.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
describe('Create New Post API Test API', () => {
it('should create new post', () => {
cy.api('POST', 'https://jsonplaceholder.typicode.com/posts', {
title: 'foo',
body: 'bar',
userId: 1,
}).should((response) => {
expect(response.status).to.eq(201);
expect(response.body).to.have.property('id');
});
});
});
19 changes: 19 additions & 0 deletions cypress/e2e/hwcypress/task1.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
describe("Stepper", ()=>{
it("should work",()=>{
const containerSelector = 'nb-stepper[orientation="horizontal"]'
cy.visit("http://localhost:4200/pages/layout/stepper")
cy.get(`${containerSelector} h3`).should("have.text","Step content #1")
cy.get(`${containerSelector} button`).contains("prev").should("be.disabled")
cy.get(`${containerSelector} button`).contains("next").click()
cy.get(`${containerSelector} h3`).should("have.text","Step content #2")
cy.get(`${containerSelector} button`).contains("prev").should("be.enabled")
cy.get(`${containerSelector} button`).contains("next").click()
cy.get(`${containerSelector} h3`).should("have.text","Step content #3")
cy.get(`${containerSelector} button`).contains("prev").should("be.enabled")
cy.get(`${containerSelector} button`).contains("next").click()
cy.get(`${containerSelector} h3`).should("have.text","Step content #4")
cy.get(`${containerSelector} button`).contains("prev").should("be.enabled")
cy.get(`${containerSelector} button`).contains("next").should("be.disabled")

})
})
11 changes: 11 additions & 0 deletions cypress/e2e/hwcypress/task2.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
describe('modal-overlays', () => {
it('Click Button and Verify Modal Dialog', () => {
const containerSelector = 'ngx-modal-overlays nb-card';
cy.visit('http://localhost:4200/pages/modal-overlays/dialog');
cy.contains('.appearance-filled.size-medium.shape-rectangle.status-basic.nb-transition', 'Enter Name').click();
cy.get('button[status="success"].appearance-filled.size-medium.shape-rectangle.nb-transition')
.should('exist')
.and('be.visible');

});
});
15 changes: 15 additions & 0 deletions cypress/e2e/hwcypress/task3.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
describe('modal-overlays', () => {
it('Click Button and Verify Modal Dialog Content', () => {
cy.visit('http://localhost:4200/pages/modal-overlays/dialog');
cy.contains('.appearance-filled.size-medium.shape-rectangle.status-basic.nb-transition', 'Enter Name').click();
cy.get('input[placeholder="Name"].size-medium.status-basic.shape-rectangle.nb-transition')
.should('exist');
cy.get('nb-card-header').should('exist').and('contain', 'Enter your name');
cy.get('button[status="success"].appearance-filled.size-medium.shape-rectangle.nb-transition')
.should('exist')
.and('contain', 'Submit');
cy.get('button[status="danger"].appearance-filled.size-medium.shape-rectangle.nb-transition')
.should('exist')
.and('have.text', 'Cancel');
});
});
10 changes: 10 additions & 0 deletions delete.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
describe('Delete Post by ID API Test API', () => {
it('should delete post by id', () => {
cy.api('DELETE', 'https://jsonplaceholder.typicode.com/posts/1')
.should((response) => {
expect(response.status).to.eq(200);
});
});
});


10 changes: 10 additions & 0 deletions get-posts-list.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
describe('Get Posts List API Test API', () => {
it('should get posts list', () => {
cy.api('GET', 'https://jsonplaceholder.typicode.com/posts')
.should((response) => {
expect(response.status).to.eq(200);
expect(response.body.length).to.be.greaterThan(0);
});
});
});

8 changes: 4 additions & 4 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"@typescript-eslint/parser": "^5.43.0",
"codelyzer": "^6.0.2",
"conventional-changelog-cli": "1.3.4",
"cypress": "^13.6.6",
"cypress": "^13.7.0",
"eslint": "^8.28.0",
"husky": "0.13.3",
"jasmine-core": "~3.6.0",
Expand Down
9 changes: 9 additions & 0 deletions post-by-id.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
describe('Get Post by ID API Test API', () => {
it('should get post by id', () => {
cy.api('GET', 'https://jsonplaceholder.typicode.com/posts/1')
.should((response) => {
expect(response.status).to.eq(200);
expect(response.body).to.have.property('id', 1);
});
});
});
29 changes: 29 additions & 0 deletions qodana.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#-------------------------------------------------------------------------------#
# Qodana analysis is configured by qodana.yaml file #
# https://www.jetbrains.com/help/qodana/qodana-yaml.html #
#-------------------------------------------------------------------------------#
version: "1.0"

#Specify inspection profile for code analysis
profile:
name: qodana.starter

#Enable inspections
#include:
# - name: <SomeEnabledInspectionId>

#Disable inspections
#exclude:
# - name: <SomeDisabledInspectionId>
# paths:
# - <path/where/not/run/inspection>

#Execute shell command before Qodana execution (Applied in CI/CD pipeline)
#bootstrap: sh ./prepare-qodana.sh

#Install IDE plugins before Qodana execution (Applied in CI/CD pipeline)
#plugins:
# - id: <plugin.id> #(plugin id can be found at https://plugins.jetbrains.com)

#Specify Qodana linter for analysis (Applied in CI/CD pipeline)
linter: jetbrains/qodana-js:latest
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"name": "tslint-language-service"
}
],
"useDefineForClassFields": false
"useDefineForClassFields": false,
"baseUrl": "./src"
}
}
15 changes: 15 additions & 0 deletions update-post-by-id.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
describe('Update Post by ID API Test API', () => {
it('should update post by id', () => {
cy.api('PUT', 'https://jsonplaceholder.typicode.com/posts/1', {
id: 1,
title: 'foo',
body: 'bar',
userId: 1,
}).should((response) => {
expect(response.status).to.eq(200);
expect(response.body).to.have.property('title', 'foo');
});
});
});