From 291803c31f829fe0d32bb3207bc11def95a7408c Mon Sep 17 00:00:00 2001 From: Nevena Bojovic Date: Tue, 1 Mar 2022 20:05:50 +0100 Subject: Urađena test aplikacija. Povezan front i back. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../angular/e2e/files/protractor.conf.js.template | 37 ++++++++++++++++++++++ .../angular/e2e/files/src/app.e2e-spec.ts.template | 23 ++++++++++++++ .../angular/e2e/files/src/app.po.ts.template | 11 +++++++ .../angular/e2e/files/tsconfig.json.template | 13 ++++++++ 4 files changed, 84 insertions(+) create mode 100644 sandbox/testAppNevena/Front/node_modules/@schematics/angular/e2e/files/protractor.conf.js.template create mode 100644 sandbox/testAppNevena/Front/node_modules/@schematics/angular/e2e/files/src/app.e2e-spec.ts.template create mode 100644 sandbox/testAppNevena/Front/node_modules/@schematics/angular/e2e/files/src/app.po.ts.template create mode 100644 sandbox/testAppNevena/Front/node_modules/@schematics/angular/e2e/files/tsconfig.json.template (limited to 'sandbox/testAppNevena/Front/node_modules/@schematics/angular/e2e/files') diff --git a/sandbox/testAppNevena/Front/node_modules/@schematics/angular/e2e/files/protractor.conf.js.template b/sandbox/testAppNevena/Front/node_modules/@schematics/angular/e2e/files/protractor.conf.js.template new file mode 100644 index 00000000..361e7f0c --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@schematics/angular/e2e/files/protractor.conf.js.template @@ -0,0 +1,37 @@ +// @ts-check +// Protractor configuration file, see link for more information +// https://github.com/angular/protractor/blob/master/lib/config.ts + +const { SpecReporter, StacktraceOption } = require('jasmine-spec-reporter'); + +/** + * @type { import("protractor").Config } + */ +exports.config = { + allScriptsTimeout: 11000, + specs: [ + './src/**/*.e2e-spec.ts' + ], + capabilities: { + browserName: 'chrome' + }, + directConnect: true, + SELENIUM_PROMISE_MANAGER: false, + baseUrl: 'http://localhost:4200/', + framework: 'jasmine', + jasmineNodeOpts: { + showColors: true, + defaultTimeoutInterval: 30000, + print: function() {} + }, + onPrepare() { + require('ts-node').register({ + project: require('path').join(__dirname, './tsconfig.json') + }); + jasmine.getEnv().addReporter(new SpecReporter({ + spec: { + displayStacktrace: StacktraceOption.PRETTY + } + })); + } +}; \ No newline at end of file diff --git a/sandbox/testAppNevena/Front/node_modules/@schematics/angular/e2e/files/src/app.e2e-spec.ts.template b/sandbox/testAppNevena/Front/node_modules/@schematics/angular/e2e/files/src/app.e2e-spec.ts.template new file mode 100644 index 00000000..a6cfbf93 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@schematics/angular/e2e/files/src/app.e2e-spec.ts.template @@ -0,0 +1,23 @@ +import { browser, logging } from 'protractor'; +import { AppPage } from './app.po'; + +describe('workspace-project App', () => { + let page: AppPage; + + beforeEach(() => { + page = new AppPage(); + }); + + it('should display welcome message', async () => { + await page.navigateTo(); + expect(await page.getTitleText()).toEqual('<%= relatedAppName %> app is running!'); + }); + + afterEach(async () => { + // Assert that there are no errors emitted from the browser + const logs = await browser.manage().logs().get(logging.Type.BROWSER); + expect(logs).not.toContain(jasmine.objectContaining({ + level: logging.Level.SEVERE, + } as logging.Entry)); + }); +}); diff --git a/sandbox/testAppNevena/Front/node_modules/@schematics/angular/e2e/files/src/app.po.ts.template b/sandbox/testAppNevena/Front/node_modules/@schematics/angular/e2e/files/src/app.po.ts.template new file mode 100644 index 00000000..16143fc9 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@schematics/angular/e2e/files/src/app.po.ts.template @@ -0,0 +1,11 @@ +import { browser, by, element } from 'protractor'; + +export class AppPage { + async navigateTo(): Promise { + return browser.get(browser.baseUrl); + } + + async getTitleText(): Promise { + return element(by.css('<%= rootSelector %> .content span')).getText(); + } +} diff --git a/sandbox/testAppNevena/Front/node_modules/@schematics/angular/e2e/files/tsconfig.json.template b/sandbox/testAppNevena/Front/node_modules/@schematics/angular/e2e/files/tsconfig.json.template new file mode 100644 index 00000000..0286f50c --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/@schematics/angular/e2e/files/tsconfig.json.template @@ -0,0 +1,13 @@ +/* To learn more about this file see: https://angular.io/config/tsconfig. */ +{ + "extends": "<%= relativePathToWorkspaceRoot %>/tsconfig.json", + "compilerOptions": { + "outDir": "<%= relativePathToWorkspaceRoot %>/out-tsc/e2e", + "module": "commonjs", + "target": "es2019", + "types": [ + "jasmine", + "node" + ] + } +} -- cgit v1.2.3