Skip to content

Commit

Permalink
fix file system firebase, auth layout, layout login and register pages
Browse files Browse the repository at this point in the history
add multiview config, cypress tests, debug to server, etc...
  • Loading branch information
nonodev96 committed Dec 3, 2021
1 parent 420b38a commit 5ac7865
Show file tree
Hide file tree
Showing 48 changed files with 1,274 additions and 584 deletions.
9 changes: 6 additions & 3 deletions cypress/integration/app.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
describe('My First Test', () => {

before(() => {
cy.visit('/login');
cy.THUMDER_SignOut();
cy.THUMDER_login();
cy.visit('/');
});

beforeEach(() => {
cy.setCookie('user', JSON.stringify(Cypress.env('USER_COOKIES')));
cy.visit('/'); // Reload page
});

it('Visits the initial project page', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
describe('Auth access', () => {

before(() => {
cy.visit('/');
});

beforeEach(() => {
cy.visit('/login');
cy.setCookie('user', JSON.stringify(null));
cy.visit('/'); // Reload page

cy.THUMDER_SignOut();
cy.THUMDER_login();
});
Expand Down
112 changes: 112 additions & 0 deletions cypress/integration/calculator.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
describe('Tests calculator', () => {

before(() => {
cy.visit('/');
cy.setCookie('user', JSON.stringify(Cypress.env('USER_COOKIES')));
cy.visit('/'); // Reload page
cy.THUMDER_goCalculator();
});

beforeEach(() => {
});

it('Check byte', () => {
cy.get("#byte_value").clear().type('123');
cy.get("#byte_binary").should('have.value', '01111011');
cy.get("#byte_hex").should('have.value', '7B');

cy.get("#byte_hex").clear().type('FF');
cy.get("#byte_binary").should('have.value', '11111111');
cy.get("#byte_value").should('have.value', '255');

cy.get("#byte_binary").clear().type('00001111');
cy.get("#byte_value").should('have.value', '15');
cy.get("#byte_hex").should('have.value', '0F');
});

it('Check HalfWord', () => {
cy.get("#halfword_value").clear().type('123');
cy.get("#halfword_binary").should('have.value', '0000000001111011');
cy.get("#halfword_hex").should('have.value', '007B');

cy.get("#halfword_hex").clear().type('00FF');
cy.get("#halfword_binary").should('have.value', '0000000011111111');
cy.get("#halfword_value").should('have.value', '255');

cy.get("#halfword_binary").clear().type('1111111111111111');
cy.get("#halfword_value").should('have.value', '65535');
cy.get("#halfword_hex").should('have.value', 'FFFF');
});

it('Check Word', () => {
cy.get("#word_value").clear().type('255');
cy.get("#word_binary").should('have.value', '00000000000000000000000011111111');
cy.get("#word_hex").should('have.value', '000000FF');

cy.get("#word_hex").clear().type('00001000');
cy.get("#word_binary").should('have.value', '00000000000000000001000000000000');
cy.get("#word_value").should('have.value', '4096');

cy.get("#word_binary").clear().type('11111111111111111111111111111111');
cy.get("#word_value").should('have.value', '4294967295');
cy.get("#word_hex").should('have.value', 'FFFFFFFF');
});

it('Check Float SubNormal', () => {
// 1
cy.get("#ieee754_number").clear().type('1');
cy.get("#ieee754_binary").should('have.value', '00111111100000000000000000000000');
cy.get("#ieee754_hex").should('have.value', '3F800000');

// 2
cy.get("#ieee754_number").clear().type('{rightarrow}2');
cy.get("#ieee754_binary").should('have.value', '01000000000000000000000000000000');
cy.get("#ieee754_hex").should('have.value', '40000000');

// -1
cy.get("#ieee754_number").clear().type('{rightarrow}1{leftarrow}{backspace}-');
cy.get("#ieee754_binary").should('have.value', '10111111100000000000000000000000');
cy.get("#ieee754_hex").should('have.value', 'BF800000');

// -2
cy.get("#ieee754_number").clear().type('{rightarrow}2{leftarrow}{backspace}-');
cy.get("#ieee754_binary").should('have.value', '11000000000000000000000000000000');
cy.get("#ieee754_hex").should('have.value', 'C0000000');

// PI
cy.get("#ieee754_number").clear().type('{rightarrow}31415{movetostart}{rightarrow}{backspace}');
cy.get("#ieee754_number").type('{movetostart}{rightarrow}.');
cy.get("#ieee754_binary").should('have.value', '01000000010010010000111001010110');
cy.get("#ieee754_hex").should('have.value', '40490E56');
});

it('Check Double SubNormal', () => {
// 1
cy.get("#ieee754_number_64").clear().type('1');
cy.get("#ieee754_binary_64").should('have.value', '0011111111110000000000000000000000000000000000000000000000000000');
cy.get("#ieee754_hex_64").should('have.value', '3FF0000000000000');

// 2
cy.get("#ieee754_number_64").clear().type('{rightarrow}2');
cy.get("#ieee754_binary_64").should('have.value', '0100000000000000000000000000000000000000000000000000000000000000');
cy.get("#ieee754_hex_64").should('have.value', '4000000000000000');

// -1
cy.get("#ieee754_number_64").clear().type('{rightarrow}1{leftarrow}{backspace}-');
cy.get("#ieee754_binary_64").should('have.value', '1011111111110000000000000000000000000000000000000000000000000000');
cy.get("#ieee754_hex_64").should('have.value', 'BFF0000000000000');

// -2
cy.get("#ieee754_number_64").clear().type('{rightarrow}2{leftarrow}{backspace}-');
cy.get("#ieee754_binary_64").should('have.value', '1100000000000000000000000000000000000000000000000000000000000000');
cy.get("#ieee754_hex_64").should('have.value', 'C000000000000000');

// PI
cy.get("#ieee754_number_64").clear().type('{rightarrow}31415{movetostart}{rightarrow}{backspace}');
cy.get("#ieee754_number_64").type('{movetostart}{rightarrow}.');
cy.get("#ieee754_binary_64").should('have.value', '0100000000001001001000011100101011000000100000110001001001101111');
cy.get("#ieee754_hex_64").should('have.value', '400921CAC0831400');

});

});
31 changes: 31 additions & 0 deletions cypress/integration/cookies.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
describe('Cookies', () => {

before(() => {
cy.visit('/');
// scy.setCookie('user', JSON.stringify(Cypress.env('USER_COOKIES')));
cy.visit('/'); // Reload page
});

beforeEach(() => {
cy.clearCookie('cookieconsent_status');
cy.visit('/'); // Reload page
cy.wait(1000);
});

it('Allow cookies', () => {
cy.get('.cc-window').then($element => {
if ($element.is(':visible')) {
cy.get('.cc-allow').click();
}
});
});

it('Decline cookies', () => {
cy.get('.cc-window').then($element => {
if ($element.is(':visible')) {
cy.get('.cc-deny').click();
}
});
});

});
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
describe('Cycle Clock Diagram', () => {

before(() => {
cy.visit('/');
});

beforeEach(() => {
cy.visit('/login');
cy.setCookie('user', JSON.stringify(Cypress.env('USER_COOKIES')));
cy.visit('/'); // Reload page

cy.THUMDER_SignOut();
cy.THUMDER_login();
cy.THUMDER_goCycleClockDiagram();
Expand Down
6 changes: 6 additions & 0 deletions cypress/integration/lang.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ describe('Tests lang', () => {

beforeEach(() => {
cy.visit('/');
});

beforeEach(() => {
cy.setCookie('user', JSON.stringify(Cypress.env('USER_COOKIES')));
cy.visit('/'); // Reload page

cy.THUMDER_SignOut();
cy.THUMDER_login();
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
describe('Memory page', () => {

before(() => {
cy.visit('/');
});

beforeEach(() => {
cy.visit('/');
cy.THUMDER_SignOut();
cy.THUMDER_login();
cy.setCookie('user', JSON.stringify(Cypress.env('USER_COOKIES')));
cy.visit('/'); // Reload page

cy.wait(1000);
cy.THUMDER_goMemory();
cy.get('#editMemoryModalButton').click();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,84 +1,90 @@
describe('Visit pages no auth', () => {
describe('Visit pages auth', () => {

beforeEach(() => {
before(() => {
cy.visit('/');
});

it('go to login', () => {
cy.visit('/login');
cy.url().should('contain', '/login');
beforeEach(() => {
cy.setCookie('user', JSON.stringify(Cypress.env('USER_COOKIES')));
cy.visit('/'); // Reload page
});

it('go to forgot my password', () => {
cy.visit('/forgot-password');
cy.url().should('contain', '/forgot-password');
it('can visit Multiview', () => {
cy.THUMDER_goMultiview();
});

it('go to register a new membership', () => {
cy.visit('/register');
cy.url().should('contain', '/register');
cy.contains('Register a new membership');
it('can visit calculator', () => {
cy.THUMDER_goCalculator();
});

});

describe('Visit pages auth', () => {

before(() => {
cy.visit('/login');
it('can visit Code', () => {
cy.THUMDER_goCode();
});

beforeEach(() => {
cy.THUMDER_SignOut();
cy.THUMDER_login();
// cy.THUMDER_login()
it('can visit Config', () => {
cy.THUMDER_goConfig();
});

it('can visit calculator', () => {
cy.THUMDER_goCalculator();
it('can visit Documentation', () => {
cy.THUMDER_goDocumentation();
});

it('can visit file-manager', () => {
it('can visit File manager', () => {
cy.THUMDER_goFileManager();
});

it('can visit IDE', () => {
cy.THUMDER_goIDE();
});

it('can visit Pipeline', () => {
cy.THUMDER_goPipeline();
it('can visit Logger', () => {
cy.THUMDER_goLogger();
});

it('can visit Memory', () => {
cy.THUMDER_goMemory();
});

it('can visit Cycle clock diagram', () => {
cy.THUMDER_goCycleClockDiagram();
});

it('can visit Memory', () => {
cy.THUMDER_goMemory();
it('can visit Pipeline', () => {
cy.THUMDER_goPipeline();
});

it('can visit Code', () => {
cy.THUMDER_goCode();
it('can visit Profile', () => {
cy.THUMDER_goProfile();
});

it('can visit Registers', () => {
cy.THUMDER_goRegisters();
});

it('can visit Profile', () => {
cy.THUMDER_goProfile();
it('can visit Statistics', () => {
cy.THUMDER_goStatistics();
});

it('can visit Documentation', () => {
cy.THUMDER_goDocumentation();
});
describe('Visit pages no auth', () => {

beforeEach(() => {
});

it('can visit Config', () => {
cy.THUMDER_goConfig();
it('go to login', () => {
cy.visit('/login');
cy.url().should('contain', '/login');
});

it('can visit Multiview', () => {
cy.THUMDER_goMultiview();
it('go to forgot my password', () => {
cy.visit('/forgot-password');
cy.url().should('contain', '/forgot-password');
});

it('go to register a new membership', () => {
cy.visit('/register');
cy.url().should('contain', '/register');
cy.contains('Register a new membership');
});

});
13 changes: 13 additions & 0 deletions cypress/support/commands/goToPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ export function THUMDER_goPipeline() {
cy.location('pathname').should('eq', '/auth/pipeline');
}

export function THUMDER_goLogger() {
THUMDER_openNavigation();
cy.get('a[title="logger"]').click();
cy.location('pathname').should('eq', '/auth/logger');
}

export function THUMDER_goCycleClockDiagram() {
THUMDER_openNavigation();
cy.get('a[title="cycle-clock-diagram"]').click();
Expand All @@ -55,6 +61,13 @@ export function THUMDER_goRegisters() {
cy.location('pathname').should('eq', '/auth/registers');
}


export function THUMDER_goStatistics() {
THUMDER_openNavigation();
cy.get('a[title="statistics"]').click();
cy.location('pathname').should('eq', '/auth/statistics');
}

export function THUMDER_goProfile() {
THUMDER_openNavigation();
cy.get('a[title="profile"]').click();
Expand Down
Loading

0 comments on commit 5ac7865

Please sign in to comment.