Skip to content

Commit 1f54f6e

Browse files
Business Logic
1 parent 89ba1b1 commit 1f54f6e

File tree

5 files changed

+44
-8
lines changed

5 files changed

+44
-8
lines changed

.vscode/launch.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "node",
9+
"request": "launch",
10+
"name": "Launch via NPM",
11+
"runtimeExecutable": "npm",
12+
"runtimeArgs": [
13+
"--debug=5858",
14+
"test"
15+
],
16+
"protocol": "inspector"
17+
}
18+
]
19+
}

npm-debug.log.1185432553

Whitespace-only changes.

shared/business-logic.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { browser } from "protractor";
2+
3+
export class BusinessLogic{
4+
5+
testCodestellar(): string{
6+
browser.ignoreSynchronization = false;
7+
browser.waitForAngularEnabled(false);
8+
browser.driver.get('http://codestellar.net/');
9+
if(expect(browser.getTitle()).toContain('Codestellar.Net')){
10+
return 'Test ran successfully';
11+
}
12+
13+
return 'Not run';
14+
}
15+
}

specs/first.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { ElementFinder, browser, by, element } from 'protractor';
22
describe('angularjs homepage todo list', function () { //Suite in Jasmine
33
it('should add a todo', function () { // Test in Jasmine
4+
console.log('hello gaurav');
45
browser.get('https://angularjs.org'); // Entering application url in browser
56
// Enter text under TODO
67
element(by.model('todoList.todoText')).sendKeys('write first protractor test');

specs/second.spec.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import { browser, element, by, By, $, $$, ExpectedConditions } from 'protractor';
2-
describe('Technossus website', function () { //Suite in Jasmine
3-
it('should have Technossus in title', function () { // Test in Jasmine
4-
5-
browser.ignoreSynchronization = false;
6-
browser.waitForAngularEnabled(false);
7-
8-
browser.driver.get('http://angularjs.org/');
9-
expect(browser.getTitle()).toContain('AngularJS');
2+
import { BusinessLogic } from '../shared/business-logic';
3+
4+
5+
describe('Codestellar website', function () { //Suite in Jasmine
6+
it('should have Codestellar in title', function () { // Test in Jasmine
7+
8+
let obj = new BusinessLogic();
9+
let result = obj.testCodestellar();
10+
console.log(result);
1011

1112
});
1213
});

0 commit comments

Comments
 (0)