Skip to content

Commit

Permalink
Products table showed josdejong#19 (josdejong#56)
Browse files Browse the repository at this point in the history
* Add scenario

* extra spaces

* expand uploadFile for specify different files

* change action for use fieName

* too early try to upload file

* trying to fix login unstability

Co-authored-by: Aleksey Gerasimov <starostin13@outlook.com>
  • Loading branch information
anzud and starostin13 committed May 13, 2020
1 parent 566b4b1 commit 7038ed8
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 30 deletions.
55 changes: 55 additions & 0 deletions src/assets/dump-longInput-gm-holdback.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
12/3/2019 BARS Reprint


RARPK028 BARS 12/02/2019
HOLDBACK DETAIL REPORT 00:06:17
REPORT PERIOD 11/01/2019 TO 11/30/2019 PAGE 1

BAC: 114394
BMD: 13 19084


SS/SITE CODE 13 19084


STATEMENT INVOICE INVOICE TOTAL
DATE VIN NUMBER DATE AMOUNT

01/31/20 1G1ZD5ST5 LF051052 1OD94914685 11/12/19 934.50
01/31/20 1G1JD5SB0 L4103011 1OD94737466 11/07/19 593.85
01/31/20 1G1FY6S07 L4106258 1OD95576574 11/25/19 1,137.75
01/31/20 1G1FG1R72 L0112873 1OD94454666 11/01/19 1,379.55
01/31/20 1G1FH1R7X L0116201 1OD95319819 11/20/19 1,463.10
01/31/20 1GCUYBEF9 LZ149574 1OD94501748 11/04/19 1,323.90
01/31/20 1GC4YLE7X LF157828 1OD94442190 11/01/19 1,284.30
01/31/20 1GC4YPEY2 LF166314 1OD95369152 11/21/19 2,113.65
01/31/20 3GCUYDET7 LG182350 1OD95216841 11/18/19 1,607.25
01/31/20 1GNSKJKC4 LR187301 1OD94572723 11/04/19 2,279.55
01/31/20 1GNSKBKC9 LR187378 1OD94570776 11/04/19 1,970.85
01/31/20 3GCUYDED0 LG193537 1OD95639794 11/26/19 1,475.40
01/31/20 3GCUYDED6 LG193543 1OD95706007 11/27/19 1,475.40
01/31/20 3GCUYDED9 LG194203 1OD95706247 11/27/19 1,437.90
01/31/20 1GNSKBKC0 LR198589 1OD95033998 11/14/19 1,962.45
01/31/20 2GCVKNEC5 K1230799 1OD94615282 11/05/19 1,160.25
01/31/20 2GCVKNEC0 K1231861 1OD94769907 11/07/19 1,187.55
01/31/20 KL8CB6SA1 LC418711 1OD94696167 11/06/19 429.60
01/31/20 KL8CB6SA4 LC421974 1OD94696258 11/06/19 441.45
01/31/20 3GNKBHRSX LS588659 1OD94999173 11/13/19 1,225.20

TOTAL 26,883.45


GRAND TOTAL
01/31/20 24 34,059.75




BUD CLARY CHEVROLET INC.
PO BOX 127
LONGVIEW WA 98632-7079




https://barsrr.autopartners.net/main/documentdetail?index=D012.13.19084.20191101&sellcd=13&dlrcd=19084 1/1
9 changes: 2 additions & 7 deletions src/features/home-page.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,13 @@ Feature: Home page
Because I want to get access to any job

Background:
Given I open the url "https://dash-staging.accumatic.com/sign-out"
Then I wait on element "form.dash-form" for 5000ms to be displayed
When I open the url "https://dash-staging.accumatic.com/sign-in"
When I set "beepbeep" to the inputfield "#dash-form-field-password"
When I set "aleksey.gerasimov@akvelon.com" to the inputfield "#dash-form-field-email"
And I press "Enter"
Given I authorized as Dealer

@Verbose
Scenario: Scrolling list of jobs
Given I wait on element "div.job-item" for 5000ms to be displayed
Then I expect that element "div.job-item" does appear exactly "20" times
When I scroll to bottom of element ".jobs-items-view"
When I scroll to bottom of element ".jobs-items-view"
Then I wait on element "div.wait-box" for 5000ms to be displayed
When I scroll to bottom of element "div.wait-box"
Then I wait on element "div.wait-box.wait-box--with-spinner" for 5000ms to not be displayed
Expand Down
14 changes: 11 additions & 3 deletions src/features/job-page.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,30 @@ Feature: Page of the job
@Verbose
Scenario: Button for download result is available
Then I wait on element "label.file-upload-button" for 2000ms to be displayed
When I upload file
When I upload "dump-input-gm-warranty.txt" file
Then I wait on element "div.job-document-item.preview-document a.download-icon-wrapper" for 20000ms to be displayed

@Verbose
Scenario: Delete job
Then I wait on element "label.file-upload-button" for 2000ms to be displayed
When I upload file
When I upload "dump-input-gm-warranty.txt" file
Then I wait on element "div.info-box.success div a:nth-child(3)" for 10000ms to be displayed
When I click on the button "div.info-box.success div a:nth-child(3)"
Then I expect that the url is "https://dash-staging.accumatic.com/jobs"

@Verbose
Scenario: Job details
Then I wait on element "label.file-upload-button" for 2000ms to be displayed
When I upload file
When I upload "dump-input-gm-warranty.txt" file
Then I wait on element "div.job-details i.accu-material-icons.accu-icon.success" for 3000ms to be displayed
And I expect that element "h2.job-title" contains the text "General Motors Warranty"
And I expect that element "div.job-details div.job-documents-wrapper p" matches the text "Creator: aleksey.gerasimov@akvelon.com"
And I expect that element "div.division-item div.division-item-name a" matches the text "101 - Bud Clary Chevrolet Subaru"

@Verbose
Scenario: Product table is showed
Then I wait on element "label.file-upload-button" for 3000ms to be displayed
When I upload "dump-input-gm-warranty.txt" file
Then I wait on element "table.data-grid.table-datasheet" for 10000ms to be displayed
And I expect that element "table.data-grid.table-datasheet tbody tr:nth-child(2) td:nth-child(2)" does exist
And I expect that element "table.data-grid.table-datasheet tbody tr:nth-child(2) td:nth-child(2)" is not empty
4 changes: 3 additions & 1 deletion src/features/previewModalWindow.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ Feature: Modal window with preview of output document

@Verbose
Scenario: Able to switch page of items
Then I wait on element "div.job-item" for 2000ms to be displayed
Then I wait on element "div.info-box.success div.info-box-content label.file-upload-button" for 2000ms to be displayed
When I upload "dump-longInput-gm-holdback.txt" file
Then I wait on element "div.job-item" for 3000ms to be displayed
When I click on the element "div.job-item"
Then I wait on element "a.preview-icon-wrapper" for 2000ms to be displayed
When I click on the element "a.preview-icon-wrapper"
Expand Down
2 changes: 1 addition & 1 deletion src/steps/when.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,6 @@ When(
);

When(
/^I upload file$/,
/^I upload "([^"]*)?" file$/,
uploadFile,
)
35 changes: 19 additions & 16 deletions src/support/action/authorizationOrSkip.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { expect } from "chai";

/**
* Open the given URL
* @param {String} role role of user (Dealer or Administrator)
Expand All @@ -6,21 +8,22 @@ export function authorizationOrSkip(role: 'Dealer' | 'Administrator'): void {
browser.url('http://dash-staging.accumatic.com');
browser.pause(1000);
const currentUrl = browser.getUrl();
if (currentUrl.includes('jobs')) {
$('div.name')['waitForExist'](5000, false);
return;
}

const emailSelector = '#dash-form-field-email';
const passwordSelector = '#dash-form-field-password';
$(emailSelector)['waitForExist'](5000, false);
if (role === 'Dealer') {
$(emailSelector)['setValue']('aleksey.gerasimov@akvelon.com');
$(passwordSelector)['setValue']('beepbeep');
}
else {
$(emailSelector)['setValue']('chadwick@accumatic.com');
$(passwordSelector)['setValue']('beepbeep');
if (!currentUrl.includes('jobs')) {
const emailSelector = '#dash-form-field-email';
const passwordSelector = '#dash-form-field-password';
$(emailSelector)['waitForExist'](5000, false);
if (role === 'Dealer') {
$(emailSelector)['setValue']('aleksey.gerasimov@akvelon.com');
$(passwordSelector)['setValue']('beepbeep');
}
else {
$(emailSelector)['setValue']('chadwick@accumatic.com');
$(passwordSelector)['setValue']('beepbeep');
}
browser.keys('Enter');
} else {
const displayed = $('div.name').isDisplayed();
expect(displayed).to
.equal(true, `Expected element "${'div.name'}" to be displayed`);
}
browser.keys('Enter');
}
4 changes: 2 additions & 2 deletions src/support/action/uploadFile.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path';

export function uploadFile(): void {
export function uploadFile(fileName: string): void {
const fileUpload = $('label.file-upload-button input');
browser.execute(
// assign style to elem in the browser
Expand All @@ -10,7 +10,7 @@ export function uploadFile(): void {
);
fileUpload.waitForDisplayed();

const filePath = path.join(__dirname, '../../../src/assets/dump-input-gm-warranty.txt');
const filePath = path.join(__dirname, `../../../src/assets/${fileName}`);
const remoteFilePath = browser.uploadFile(filePath);
fileUpload.setValue(remoteFilePath);
}

0 comments on commit 7038ed8

Please sign in to comment.