How to use timeField method in taiko

Best JavaScript code snippet using taiko

timefield.component.spec.ts

Source:timefield.component.spec.ts Github

copy

Full Screen

1import { ChangeDetectionStrategy, Component, Directive, Injectable, Type, ViewChild } from '@angular/core';2import { ComponentFixture, fakeAsync, TestBed, tick, waitForAsync } from '@angular/core/testing';3import { FormBuilder, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms';4import { NxTimefieldComponent } from './timefield.component';5import { NxTimefieldModule } from './timefield.module';6import { NxTimefieldIntl } from './timefield-intl';7@Directive()8abstract class TimefieldTest {9 @ViewChild(NxTimefieldComponent) timefieldInstance!: NxTimefieldComponent;10 label = '';11 negative = false;12 disabled = false;13 required = false;14 time = '';15 twelveHourFormat = false;16}17@Injectable()18class MyIntl extends NxTimefieldIntl {19 inputFieldHoursAriaLabel = 'stunden';20 inputFieldMinutesAriaLabel = 'minuten';21}22describe('NxTimefieldComponent', () => {23 let fixture: ComponentFixture<TimefieldTest>;24 let testInstance: TimefieldTest;25 let timefieldInstance: NxTimefieldComponent;26 let timefieldElement: HTMLElement;27 let inputElementHours: HTMLInputElement;28 let inputElementMinutes: HTMLInputElement;29 let spanElementSeperator: HTMLSpanElement;30 let divElementInputFields: HTMLDivElement;31 let divElementsWrapper: HTMLDivElement;32 function createTestComponent(component: Type<TimefieldTest>) {33 fixture = TestBed.createComponent(component);34 fixture.detectChanges();35 testInstance = fixture.componentInstance;36 timefieldInstance = testInstance.timefieldInstance;37 timefieldElement = fixture.nativeElement.querySelector('nx-timefield');38 inputElementHours = fixture.nativeElement.querySelector('.nx-timefield-input__field__hours') as HTMLInputElement;39 inputElementMinutes = fixture.nativeElement.querySelector('.nx-timefield-input__field__minutes') as HTMLInputElement;40 spanElementSeperator = fixture.nativeElement.querySelector('.nx-timefield-hours-separator') as HTMLSpanElement;41 divElementInputFields = fixture.nativeElement.querySelector('.nx-timefield-input__fields') as HTMLDivElement;42 divElementsWrapper = fixture.nativeElement.querySelector('.nx-timefield__wrapper') as HTMLDivElement;43 }44 const assertTime = (time: string) => {45 fixture.detectChanges();46 expect(timefieldInstance.time).toBe(time);47 };48 const flushAndAssertTime = (time: string) => {49 fixture.detectChanges();50 tick();51 fixture.detectChanges();52 tick();53 assertTime(time);54 };55 beforeEach(waitForAsync(() => {56 TestBed.configureTestingModule({57 imports: [NxTimefieldModule, FormsModule, ReactiveFormsModule],58 declarations: [59 SimpleTimefield,60 ConfigurableTimefield,61 ReactiveTimefield,62 TemplateDrivenTimefield,63 TemplateDrivenOnPushTimefield,64 OverrideDefaultLabelsTimefield,65 ],66 }).compileComponents();67 }));68 it('should create a simple timefield component', () => {69 createTestComponent(SimpleTimefield);70 expect(timefieldInstance).toBeTruthy();71 });72 it('should set minimum minutes to 0 by default', () => {73 createTestComponent(SimpleTimefield);74 expect(timefieldInstance.minMinutes).toBe(0);75 });76 it('should set minimum hours to 0 by default', () => {77 createTestComponent(SimpleTimefield);78 expect(timefieldInstance.minHours).toBe(0);79 });80 it('should set maximum minutes to 59 by default', () => {81 createTestComponent(SimpleTimefield);82 expect(timefieldInstance.maxMinutes).toBe(59);83 });84 it('should set maximum hours to 23 by default', () => {85 createTestComponent(SimpleTimefield);86 expect(timefieldInstance.maxHours).toBe(23);87 });88 it('should set 12h toggle to false by default', () => {89 createTestComponent(SimpleTimefield);90 expect(timefieldInstance._toggleAMPM).toBeFalsy();91 });92 it('should prevent setting time if timeformat is not in ISO 24h format', fakeAsync(() => {93 createTestComponent(TemplateDrivenTimefield);94 const templateInstance = testInstance as TemplateDrivenTimefield;95 flushAndAssertTime('00:00');96 templateInstance.today = '00:00:00';97 // @ts-expect-error98 flushAndAssertTime(null);99 templateInstance.today = '00-00';100 // @ts-expect-error101 flushAndAssertTime(null);102 templateInstance.today = '00/00';103 // @ts-expect-error104 flushAndAssertTime(null);105 templateInstance.today = '00.00';106 // @ts-expect-error107 flushAndAssertTime(null);108 }));109 it('should set time correctly in 24h format in template driven form with onPush change detection', fakeAsync(() => {110 createTestComponent(TemplateDrivenOnPushTimefield);111 flushAndAssertTime('00:00');112 }));113 it('should not set hours field if it is not between 0 and 23 in a template driven form', fakeAsync(() => {114 createTestComponent(TemplateDrivenTimefield);115 const templateInstance = testInstance as TemplateDrivenTimefield;116 templateInstance.today = '24:00';117 // @ts-expect-error118 flushAndAssertTime(null);119 fixture.detectChanges();120 tick();121 expect(timefieldInstance.hours).toBe('');122 }));123 it('should not set minutes field if it is not between 0 and 59 in a template driven form', fakeAsync(() => {124 createTestComponent(TemplateDrivenTimefield);125 const templateInstance = testInstance as TemplateDrivenTimefield;126 templateInstance.today = '22:62';127 // @ts-expect-error128 flushAndAssertTime(null);129 fixture.detectChanges();130 tick();131 expect(timefieldInstance.minutes).toBe('');132 }));133 it('should show error when hours field is not between 0 and 23 in a reactive form', fakeAsync(() => {134 createTestComponent(ReactiveTimefield);135 const reactInstance = testInstance as ReactiveTimefield;136 reactInstance.twelveHourFormat = true;137 reactInstance.testForm.setValue({ today: '24:00' });138 fixture.detectChanges();139 tick();140 fixture.detectChanges();141 tick();142 expect(inputElementHours.value).toBe('');143 inputElementMinutes.click();144 fixture.detectChanges();145 tick();146 expect(reactInstance.testForm.status).toBe('INVALID');147 }));148 it('should show error when minutes field is not between 0 and 59 in a reactive form', fakeAsync(() => {149 createTestComponent(ReactiveTimefield);150 const reactInstance = testInstance as ReactiveTimefield;151 reactInstance.twelveHourFormat = true;152 reactInstance.testForm.setValue({ today: '11:60' });153 fixture.detectChanges();154 tick();155 fixture.detectChanges();156 tick();157 expect(inputElementMinutes.value).toBe('');158 inputElementMinutes.click();159 fixture.detectChanges();160 tick();161 expect(reactInstance.testForm.status).toBe('INVALID');162 }));163 it('should not set value for any non-numeric entries', fakeAsync(() => {164 createTestComponent(TemplateDrivenTimefield);165 const templateInstance = testInstance as TemplateDrivenTimefield;166 templateInstance.today = 'abcd';167 // @ts-expect-error168 flushAndAssertTime(null);169 fixture.detectChanges();170 tick();171 expect(timefieldInstance.minutes).toBe('');172 }));173 it('should emit change event in 24h ISO format', fakeAsync(() => {174 createTestComponent(TemplateDrivenTimefield);175 const templateInstance = testInstance as TemplateDrivenTimefield;176 flushAndAssertTime('00:00');177 const spy = spyOn(timefieldInstance.valueChange, 'emit').and.callThrough();178 templateInstance.today = '12:00';179 flushAndAssertTime('12:00');180 expect(timefieldInstance.valueChange.emit).toHaveBeenCalledWith('12:00');181 expect(spy).toHaveBeenCalledTimes(1);182 }));183 describe('twelveHourFormat', () => {184 it('should set twelveHourFormat programmatically', () => {185 createTestComponent(ConfigurableTimefield);186 timefieldInstance.twelveHourFormat = true;187 fixture.detectChanges();188 expect(timefieldInstance._toggleAMPM).toBe('AM');189 timefieldInstance.twelveHourFormat = false;190 fixture.detectChanges();191 expect(timefieldInstance._toggleAMPM).toBeNull();192 });193 it('should set minumum minutes to 0 by default', () => {194 createTestComponent(ConfigurableTimefield);195 timefieldInstance.twelveHourFormat = true;196 fixture.detectChanges();197 expect(timefieldInstance.minMinutes).toBe(0);198 });199 it('should set minumum hours to 1 by default', () => {200 createTestComponent(ConfigurableTimefield);201 timefieldInstance.twelveHourFormat = true;202 fixture.detectChanges();203 expect(timefieldInstance.minHours).toBe(1);204 });205 it('should set maximum minutes to 59 by default', () => {206 createTestComponent(ConfigurableTimefield);207 timefieldInstance.twelveHourFormat = true;208 fixture.detectChanges();209 expect(timefieldInstance.maxMinutes).toBe(59);210 });211 it('should set maximum hours to 12 by default', () => {212 createTestComponent(ConfigurableTimefield);213 timefieldInstance.twelveHourFormat = true;214 fixture.detectChanges();215 expect(timefieldInstance.maxHours).toBe(12);216 });217 it('should always set the model value in 24h format', fakeAsync(() => {218 createTestComponent(TemplateDrivenTimefield);219 const templateInstance = testInstance as TemplateDrivenTimefield;220 flushAndAssertTime('00:00');221 templateInstance.twelveHourFormat = true;222 fixture.detectChanges();223 expect(timefieldInstance._toggleAMPM).toBe('AM');224 inputElementHours.value = '12';225 inputElementMinutes.value = '00';226 fixture.detectChanges();227 tick();228 flushAndAssertTime('00:00');229 fixture.detectChanges();230 tick();231 expect(timefieldInstance.minutes).toBe('00');232 expect(timefieldInstance.hours).toBe('00');233 }));234 it('should switch correctly between am/pm and set correct 24h time in model', () => {235 createTestComponent(ConfigurableTimefield);236 timefieldInstance.twelveHourFormat = true;237 fixture.detectChanges();238 expect(timefieldInstance._toggleAMPM).toBe('AM');239 expect(timefieldInstance.minHours).toBe(1);240 expect(timefieldInstance.maxHours).toBe(12);241 timefieldInstance.twelveHourFormat = false;242 fixture.detectChanges();243 expect(timefieldInstance._toggleAMPM).toBeNull();244 expect(timefieldInstance.minHours).toBe(0);245 expect(timefieldInstance.maxHours).toBe(23);246 });247 });248 describe('disabled', () => {249 it('should update view on disabled change', () => {250 createTestComponent(ConfigurableTimefield);251 timefieldInstance.disabled = true;252 fixture.detectChanges();253 expect(timefieldElement).toHaveClass('is-disabled');254 });255 });256 describe('negative', () => {257 it('should update view on negative change', () => {258 createTestComponent(ConfigurableTimefield);259 timefieldInstance.negative = true;260 fixture.detectChanges();261 expect(timefieldElement).toHaveClass('is-negative');262 });263 });264 describe('focus', () => {265 it('should add has-focus class when any of the two inputs gets focus', fakeAsync(() => {266 createTestComponent(SimpleTimefield);267 inputElementHours.focus();268 fixture.detectChanges();269 tick();270 expect(spanElementSeperator).toHaveClass('has-focus');271 expect(divElementInputFields).toHaveClass('has-focus');272 expect(inputElementMinutes).toHaveClass('has-focus');273 inputElementHours.blur();274 inputElementMinutes.focus();275 fixture.detectChanges();276 tick();277 expect(spanElementSeperator).toHaveClass('has-focus');278 expect(divElementInputFields).toHaveClass('has-focus');279 expect(inputElementHours).toHaveClass('has-focus');280 }));281 });282 describe('blur', () => {283 it('should zero pad the hours field if the value is <10', fakeAsync(() => {284 createTestComponent(SimpleTimefield);285 inputElementHours.value = '0';286 inputElementHours.dispatchEvent(new Event('input'));287 inputElementHours.focus();288 fixture.detectChanges();289 tick();290 expect(document.activeElement).toEqual(inputElementHours);291 expect(inputElementHours.value).toBe('0');292 inputElementHours.blur();293 fixture.detectChanges();294 tick();295 fixture.detectChanges();296 tick();297 expect(timefieldInstance.hours).toBe('00');298 expect(inputElementHours.value).toBe('00');299 }));300 it('should zero pad the minutes field if the value is <10', fakeAsync(() => {301 createTestComponent(SimpleTimefield);302 inputElementMinutes.value = '0';303 inputElementMinutes.dispatchEvent(new Event('input'));304 inputElementMinutes.focus();305 fixture.detectChanges();306 tick();307 expect(document.activeElement).toEqual(inputElementMinutes);308 expect(inputElementMinutes.value).toBe('0');309 inputElementMinutes.blur();310 fixture.detectChanges();311 tick();312 fixture.detectChanges();313 tick();314 expect(timefieldInstance.minutes).toBe('00');315 expect(inputElementMinutes.value).toBe('00');316 }));317 });318 describe('validation', () => {319 it('should not show the error initially', () => {320 createTestComponent(ReactiveTimefield);321 const reactInstance = testInstance as ReactiveTimefield;322 expect(reactInstance.testForm.touched).toBeFalse();323 expect(reactInstance.testForm.status).toBe('INVALID');324 expect(timefieldElement).not.toHaveClass('has-error');325 expect(timefieldElement).toHaveClass('ng-untouched');326 });327 it('should reflect the error state', fakeAsync(() => {328 createTestComponent(ReactiveTimefield);329 const reactInstance = testInstance as ReactiveTimefield;330 // @ts-expect-error331 assertTime(null);332 expect(reactInstance.testForm.status).toBe('INVALID');333 reactInstance.testForm.patchValue({ today: '00:00' });334 fixture.detectChanges();335 tick();336 assertTime('00:00');337 expect(reactInstance.testForm.status).toBe('VALID');338 }));339 });340 describe('a11y', () => {341 it('has no accessibility violations', async () => {342 createTestComponent(SimpleTimefield);343 await expectAsync(fixture.nativeElement).toBeAccessible();344 });345 it('should overwrite the default aria labels', () => {346 createTestComponent(OverrideDefaultLabelsTimefield);347 expect(inputElementHours.getAttribute('aria-label')).toBe('stunden');348 expect(inputElementMinutes.getAttribute('aria-label')).toBe('minuten');349 });350 });351});352@Component({353 template: `<nx-timefield label="Time"></nx-timefield>`,354})355class SimpleTimefield extends TimefieldTest {}356@Component({357 template: `358 <nx-timefield [label]="label" [twelveHourFormat]="twelveHourFormat" [negative]="negative" [disabled]="disabled" [required]="required"></nx-timefield>359 `,360 changeDetection: ChangeDetectionStrategy.OnPush,361})362class ConfigurableTimefield extends TimefieldTest {}363@Component({364 template: `365 <form [formGroup]="testForm" (ngSubmit)="onSubmit()">366 <nx-timefield formControlName="today" [twelveHourFormat]="twelveHourFormat"></nx-timefield>367 </form>368 `,369 changeDetection: ChangeDetectionStrategy.OnPush,370})371class ReactiveTimefield extends TimefieldTest {372 testForm!: FormGroup;373 constructor(private fb: FormBuilder) {374 super();375 this.createForm();376 }377 createForm() {378 this.testForm = this.fb.group({379 today: ['', Validators.required],380 });381 }382}383@Component({384 template: `<nx-timefield [twelveHourFormat]="twelveHourFormat" [(ngModel)]="today"></nx-timefield>`,385})386class TemplateDrivenTimefield extends TimefieldTest {387 today = '00:00';388}389@Component({390 template: `<nx-timefield [twelveHourFormat]="twelveHourFormat" [(ngModel)]="today"></nx-timefield>`,391 changeDetection: ChangeDetectionStrategy.OnPush,392})393class TemplateDrivenOnPushTimefield extends TimefieldTest {394 today = '00:00';395}396@Component({397 template: `<nx-timefield twelveHourFormat></nx-timefield>`,398 providers: [{ provide: NxTimefieldIntl, useClass: MyIntl }],399})...

Full Screen

Full Screen

AutorizacionController.js

Source:AutorizacionController.js Github

copy

Full Screen

1Ext.define('myapp.controller.registrar.AutorizacionController', {2 extend: 'Ext.app.Controller',3 views: [4 'registrar.Autorizacion',5 'registrar.AutorizacionLista'6 ],7 refs: [{8 ref: 'AutorizacionLista',9 selector: 'autorizacionLista'10 },{11 ref: 'Autorizacion',12 selector: 'autorizacion'13 }],14 init: function(application) {15 this.control({16 "autorizacion button#guardarAutorizacion": {17 click: this.guardarAutorizacion18 },19 "autorizacion combobox[name=tipoAutorizacion]": {20 change: this.cambioCombo21 },22 "autorizacion timefield[name=horaSalida]": {23 change: this.cambioHS24 }25 }); 26 }, 2728 cambioCombo: function(){ 29 formPanel = this.getAutorizacion(),30 tipoAutorizacion= formPanel.down("combobox[name=tipoAutorizacion]").getValue();31 if(tipoAutorizacion=='1'){32 formPanel.down("timefield[name=horaSalida]").reset();33 formPanel.down("timefield[name=horaSalida]").setVisible(false);34 formPanel.down('timefield[name=horaSalida]').allowBlank = true;35 formPanel.down('timefield[name=horaSalida]').validateValue(formPanel.down('timefield[name=horaSalida]').getValue());36 formPanel.down("timefield[name=horaEntrada]").reset();37 formPanel.down("timefield[name=horaEntrada]").setVisible(true);38 formPanel.down('timefield[name=horaEntrada]').allowBlank = false;39 formPanel.down('timefield[name=horaEntrada]').validateValue(formPanel.down('timefield[name=horaEntrada]').getValue());40 formPanel.down("textfield[name=placa]").setValue('');41 formPanel.down("textfield[name=placa]").setVisible(false);42 formPanel.down('textfield[name=placa]').allowBlank = true;43 formPanel.down('textfield[name=placa]').validateValue(formPanel.down('textfield[name=placa]').getValue());44 }if(tipoAutorizacion=='2'){45 formPanel.down("timefield[name=horaSalida]").reset();46 formPanel.down("timefield[name=horaSalida]").setVisible(true);47 formPanel.down('timefield[name=horaSalida]').allowBlank = false;48 formPanel.down('timefield[name=horaSalida]').validateValue(formPanel.down('timefield[name=horaSalida]').getValue());49 formPanel.down("timefield[name=horaEntrada]").reset();50 formPanel.down("timefield[name=horaEntrada]").setVisible(false);51 formPanel.down('timefield[name=horaEntrada]').allowBlank = true;52 formPanel.down('timefield[name=horaEntrada]').validateValue(formPanel.down('timefield[name=horaEntrada]').getValue());53 formPanel.down("textfield[name=placa]").setValue('');54 formPanel.down("textfield[name=placa]").setVisible(false);55 formPanel.down('textfield[name=placa]').allowBlank = true;56 formPanel.down('textfield[name=placa]').validateValue(formPanel.down('textfield[name=placa]').getValue());57 }if(tipoAutorizacion=='3'){58 formPanel.down("timefield[name=horaSalida]").reset();59 formPanel.down("timefield[name=horaSalida]").setVisible(true); 60 formPanel.down('timefield[name=horaSalida]').allowBlank = false;61 formPanel.down('timefield[name=horaSalida]').validateValue(formPanel.down('timefield[name=horaSalida]').getValue());62 formPanel.down("timefield[name=horaEntrada]").reset();63 formPanel.down("timefield[name=horaEntrada]").setVisible(true); 64 formPanel.down('timefield[name=horaEntrada]').allowBlank = false;65 formPanel.down('timefield[name=horaEntrada]').validateValue(formPanel.down('timefield[name=horaEntrada]').getValue());66 formPanel.down("textfield[name=placa]").setValue('');67 formPanel.down("textfield[name=placa]").setVisible(false);68 formPanel.down('textfield[name=placa]').allowBlank = true;69 formPanel.down('textfield[name=placa]').validateValue(formPanel.down('textfield[name=placa]').getValue());70 }if(tipoAutorizacion=='4'){71 formPanel.down("timefield[name=horaEntrada]").reset();72 formPanel.down("timefield[name=horaEntrada]").setVisible(false);73 formPanel.down('timefield[name=horaEntrada]').allowBlank = true;74 formPanel.down('timefield[name=horaEntrada]').validateValue(formPanel.down('timefield[name=horaEntrada]').getValue());75 formPanel.down("timefield[name=horaSalida]").reset();76 formPanel.down("timefield[name=horaSalida]").setVisible(true);77 formPanel.down('timefield[name=horaSalida]').allowBlank = false;78 formPanel.down('timefield[name=horaSalida]').validateValue(formPanel.down('timefield[name=horaSalida]').getValue());79 formPanel.down("textfield[name=placa]").setValue('');80 formPanel.down("textfield[name=placa]").setVisible(true);81 formPanel.down('textfield[name=placa]').allowBlank = false;82 formPanel.down('textfield[name=placa]').validateValue(formPanel.down('textfield[name=placa]').getValue());83 }if(tipoAutorizacion==null || tipoAutorizacion=='5' || tipoAutorizacion=='6' || tipoAutorizacion=='7'){84 formPanel.down("timefield[name=horaSalida]").reset();85 formPanel.down("timefield[name=horaSalida]").setVisible(false); 86 formPanel.down('timefield[name=horaSalida]').allowBlank = true;87 formPanel.down('timefield[name=horaSalida]').validateValue(formPanel.down('timefield[name=horaSalida]').getValue());88 formPanel.down("timefield[name=horaEntrada]").reset();89 formPanel.down("timefield[name=horaEntrada]").setVisible(false); 90 formPanel.down('timefield[name=horaEntrada]').allowBlank = true;91 formPanel.down('timefield[name=horaEntrada]').validateValue(formPanel.down('timefield[name=horaEntrada]').getValue());92 formPanel.down("textfield[name=placa]").setValue('');93 formPanel.down("textfield[name=placa]").setVisible(false);94 formPanel.down('textfield[name=placa]').allowBlank = true;95 formPanel.down('textfield[name=placa]').validateValue(formPanel.down('textfield[name=placa]').getValue());96 }97 },98 cambioHS: function(){99 formPanel = this.getAutorizacion();100 hS=formPanel.down("timefield[name=horaSalida]").getValue();101 hE=formPanel.down("timefield[name=horaEntrada]").getValue();102 tipoAutorizacion= formPanel.down("combobox[name=tipoAutorizacion]").getValue();103 if(tipoAutorizacion==3){104 formPanel.down("timefield[name=horaEntrada]").reset();105 formPanel.down("timefield[name=horaEntrada]").setMinValue(hS);106 }107 },108 guardarAutorizacion: function(button, e, options) {109 me=this;110 grid = this.getAutorizacionLista();111 formPanel = this.getAutorizacion();112 f=formPanel.down("datefield[name=fechaAutorizacion]").getValue();113 hE=formPanel.down("timefield[name=horaEntrada]").getValue();114 hS=formPanel.down("timefield[name=horaSalida]").getValue();115 placa=formPanel.down("textfield[name=placa]").getValue();116 tipoAutorizacion= formPanel.down("combobox[name=tipoAutorizacion]").getValue();117 motivoAutorizacion= formPanel.down("combobox[name=motivoautorizacion]").getValue();118 modified = grid.getSelectionModel().getSelection();119 if(formPanel.getForm().isValid()){120 if(!Ext.isEmpty(modified)){121 fechaA=Ext.Date.format(f, 'Y-m-d'); 122 horaE=Ext.Date.format(hE,'H:i:s'); 123 horaS=Ext.Date.format(hS,'H:i:s');124 if(tipoAutorizacion==1 ||tipoAutorizacion==2 ||tipoAutorizacion==3 ||(tipoAutorizacion==4 && modified.length == 1) ||tipoAutorizacion==5 || tipoAutorizacion==6 || tipoAutorizacion==7){ 125 Ext.get(grid.getEl()).mask("Guardando autorizacion(s)... Por favor espere...",'loading');126 var recordsToSend = [];127 Ext.each(modified, function(record) {128 recordsToSend.push(Ext.apply(record.data));129 });130 recordsToSend = Ext.encode(recordsToSend);131 Ext.Ajax.request({132 method:'POST',133 url : '../registrar/autorizacion/guardarAutorizacion',134 params :{135 tipoAutorizacion : tipoAutorizacion,136 motivoAutorizacion : motivoAutorizacion,137 records : recordsToSend,138 fechaA : fechaA,139 horaE : horaE,140 horaS : horaS,141 placa : placa142 },143 success : function(form,action) {144 Ext.get(grid.getEl()).unmask();145 info = Ext.JSON.decode(form.responseText);146 if(info.success==true){147 if(info.data==null){148 mensaje=info.msg;149 }else{150 mensaje=info.msg+info.data;151 }152 Ext.MessageBox.show({ title: 'Informaci&oacute;n', 153 msg: mensaje, 154 buttons: Ext.MessageBox.OK, icon: Ext.MessageBox.INFO });155 formPanel.down("datefield[name=fechaAutorizacion]").reset();156 formPanel.down("timefield[name=horaEntrada]").reset();157 formPanel.down("timefield[name=horaSalida]").reset();158 formPanel.down("combobox[name=tipoAutorizacion]").reset(); 159 formPanel.down("combobox[name=motivoautorizacion]").reset();160 formPanel.down("textfield[name=placa]").reset();161 grid.getStore().load();162 me.cambioCombo();163 var selection = grid.getView().getSelectionModel().getSelection();164 if (selection.length > 0){ 165 for( var i = 0; i < selection.length; i++) {166 grid.getStore().remove(selection[i]); 167 } 168 }169 }170 }171 });172 }else{173 Ext.MessageBox.show({ title: 'Informaci&oacute;n', 174 msg: 'Para este tipo de autorizacion solo se puede seleccionar un empleado', 175 buttons: Ext.MessageBox.OK, icon: Ext.MessageBox.INFO });176 }177 }else{178 Ext.MessageBox.show({ title: 'Informaci&oacute;n', 179 msg: 'Debe seleccionar por lo menos un empleado', 180 buttons: Ext.MessageBox.OK, icon: Ext.MessageBox.INFO }); 181 } 182 }183 } ...

Full Screen

Full Screen

timefield-examples.module.ts

Source:timefield-examples.module.ts Github

copy

Full Screen

1import { NgModule } from '@angular/core';2import { NxErrorModule } from '@aposin/ng-aquila/base';3import { NxTimefieldModule } from '@aposin/ng-aquila/timefield';4import { ExamplesSharedModule } from '../examples-shared.module';5import { TimefieldDisabledExampleComponent } from './timefield-disabled/timefield-disabled-example';6import { TimefieldFormatTogglerExampleComponent } from './timefield-format-toggler/timefield-format-toggler-example';7import { TimefieldLocalizeExampleComponent } from './timefield-localize/timefield-localize-example';8import { TimefieldNegativeExampleComponent } from './timefield-negative/timefield-negative-example';9import { TimefieldReactiveExampleComponent } from './timefield-reactive/timefield-reactive-example';10import { TimefieldTemplateDrivenExampleComponent } from './timefield-template-driven/timefield-template-driven-example';11const EXAMPLES = [12 TimefieldDisabledExampleComponent,13 TimefieldFormatTogglerExampleComponent,14 TimefieldLocalizeExampleComponent,15 TimefieldNegativeExampleComponent,16 TimefieldReactiveExampleComponent,17 TimefieldTemplateDrivenExampleComponent,18];19@NgModule({20 imports: [NxTimefieldModule, ExamplesSharedModule, NxErrorModule],21 declarations: [EXAMPLES],22 exports: [EXAMPLES],23})24export class TimefieldExamplesModule {25 static components() {26 return {27 'timefield-disabled': TimefieldDisabledExampleComponent,28 'timefield-format-toggler': TimefieldFormatTogglerExampleComponent,29 'timefield-localize': TimefieldLocalizeExampleComponent,30 'timefield-negative': TimefieldNegativeExampleComponent,31 'timefield-reactive': TimefieldReactiveExampleComponent,32 'timefield-template-driven':33 TimefieldTemplateDrivenExampleComponent,34 };35 }...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1const { openBrowser, goto, timeField, closeBrowser } = require('taiko');2(async () => {3 try {4 await openBrowser();5 await goto("google.com");6 await timeField({id:"lst-ib"}).type("test");7 } catch (e) {8 console.error(e);9 } finally {10 await closeBrowser();11 }12})();13I am using taiko version 1.0.0 (Chromium: 72.0.3626.81) on Mac OS Mojave 10.14.614I am using taiko version 1.0.0 (Chromium: 72.0.3626.81) on Mac OS Mojave 10.14.615I tried with the latest version of taiko and I am getting the same error. I am using taiko version 1.0.6 (Chromium: 78.0.3882.0) on Mac OS Mojave 10.14.616I am using taiko version 1.0.6 (Chromium: 78.0.3882.0) on Mac OS Mojave 10.14.617I am using taiko version 1.0.6 (Chromium: 78.0.3882.0) on Mac OS Mojave 10.14.618I am using taiko version 1.0.6 (Chromium: 78.0.3882.0) on Mac OS Mojave 10.14.619I am using taiko version 1.0.6 (Chromium: 78.0.3882.0) on Mac OS Mojave 10.14.6

Full Screen

Using AI Code Generation

copy

Full Screen

1const { openBrowser, goto, timeField, closeBrowser } = require('taiko');2(async () => {3 try {4 await openBrowser({ headless: false });5 await switchTo('iframe');6 await timeField('appt').selectTime('06:30');7 await timeField('appt').selectTime('18:30');8 } catch (e) {9 console.error(e);10 } finally {11 await closeBrowser();12 }13})();

Full Screen

Using AI Code Generation

copy

Full Screen

1const { openBrowser, goto, closeBrowser, timeField } = require('taiko');2(async () => {3 try {4 await openBrowser({ headless: false });5 await timeField({ id: 'fakeid' }).exists();6 await closeBrowser();7 } catch (e) {8 console.error(e);9 } finally {10 }11})();12 at ExecutionContext._evaluateInternal (/Users/xxxxx/xxxxx/xxxxx/node_modules/puppeteer/lib/ExecutionContext.js:122:13)13 at processTicksAndRejections (internal/process/task_queues.js:97:5)14 at async ExecutionContext.evaluate (/Users/xxxxx/xxxxx/xxxxx/node_modules/puppeteer/lib/ExecutionContext.js:48:12)15 at async timeField (/Users/xxxxx/xxxxx/xxxxx/node_modules/taiko/lib/taiko.js:103:22)16 at async Object.<anonymous> (/Users/xxxxx/xxxxx/xxxxx/test.js:9:5)17 at async _combinedTickCallback (internal/process/next_tick.js:131:7)18 at async process._tickCallback (internal/process/next_tick.js:180:9)

Full Screen

Using AI Code Generation

copy

Full Screen

1var { openBrowser, goto, timeField, closeBrowser } = require('taiko');2(async () => {3 try {4 await openBrowser();5 await timeField("Time").selectTime("12:30");6 } catch (e) {7 console.error(e);8 } finally {9 await closeBrowser();10 }11})();12var { openBrowser, goto, timeField, closeBrowser } = require('taiko');13(async () => {14 try {15 await openBrowser();16 await timeField("Time").selectTime("12:30");17 } catch (e) {18 console.error(e);19 } finally {20 await closeBrowser();21 }22})();23const { openBrowser, goto, timeField, closeBrowser } = require('taiko');24(async () => {25 try {26 await openBrowser();27 await timeField("Time").selectTime("12:30");28 } catch (e) {29 console.error(e);30 } finally {31 await closeBrowser();32 }33})();34const { openBrowser, goto

Full Screen

Using AI Code Generation

copy

Full Screen

1const { openBrowser, goto, timeField, closeBrowser, write, click, below } = require('taiko');2(async () => {3 try {4 await openBrowser();5 await goto("google.com");6 await write("taiko", into(timeField(below("Time"))));7 await click("Google Search");8 } catch (e) {9 console.error(e);10 } finally {11 await closeBrowser();12 }13})();14 at ExecutionContext._evaluateInternal (/Users/username/Documents/taiko/node_modules/puppeteer/lib/ExecutionContext.js:122:13)15 at processTicksAndRejections (internal/process/task_queues.js:89:5)16 at async ExecutionContext.evaluate (/Users/username/Documents/taiko/node_modules/puppeteer/lib/ExecutionContext.js:48:12)17 at async DOMHandler.evaluate (/Users/username/Documents/taiko/lib/taiko.js:181:23)18 at async timeField (/Users/username/Documents/taiko/lib/taiko.js:2546:23)19 at async Object.exports.timeField (/Users/username/Documents/taiko/lib/taiko.js:2553:16)20 at async ExecutionContext._evaluateInternal (/Users/username/Documents/taiko/node_modules/puppeteer/lib/ExecutionContext.js:122:13)21 at async ExecutionContext.evaluate (/Users/username/Documents/taiko/node_modules/puppeteer/lib/ExecutionContext.js:48:12)22const { openBrowser, goto, textBox, closeBrowser, write, click, below } = require('taiko');23(async () => {24 try {25 await openBrowser();26 await goto("google.com");27 await write("taiko", into(textBox(below("Time"))));28 await click("Google Search");29 } catch (e) {30 console.error(e);31 } finally {32 await closeBrowser();33 }34})();

Full Screen

Using AI Code Generation

copy

Full Screen

1const { timeField } = require('taiko');2(async () => {3 try {4 await timeField({id:'time'}).selectTime('02:00:00');5 } catch (e) {6 console.error(e);7 } finally {8 }9})();10selectTime(time) Parameters11const { openBrowser, goto, timeField, closeBrowser } = require('taiko');12(async () => {13 try {14 await openBrowser();15 await goto("google.com");16 await timeField({id:'time'}).selectTime('02:00:00');17 } catch (e) {18 console.error(e);19 } finally {20 await closeBrowser();21 }22})();23timeField(options)24timeField(options, waitForOptions)25timeField(options, args)26timeField(by.label('Time Field'), {id:'time'})27timeField(by.label('Time Field'), {id:'time'}, {waitForEvents:['load']})28timeField(by.label('Time Field'), {id:'time'}, {waitForEvents:['load'], timeout:10000})29timeField(by.label('Time Field'), {id:'time'}, {waitForEvents:['load'], interval:100})30timeField(by.label('Time Field'), {id:'time'}, {waitForEvents:['load'], timeout:10000, interval:100})

Full Screen

Using AI Code Generation

copy

Full Screen

1const {timeField, openBrowser, goto, write, closeBrowser} = require('taiko');2(async () => {3 try {4 await openBrowser();5 await goto("localhost:8080");6 await write("test", into(timeField("Time")));7 } catch (e) {8 console.error(e);9 } finally {10 await closeBrowser();11 }12})();13 at ExecutionContext._evaluateInternal (/Users/username/taiko/node_modules/puppeteer/lib/ExecutionContext.js:122:19)14 at processTicksAndRejections (internal/process/task_queues.js:93:5)15 at async ExecutionContext.evaluate (/Users/username/taiko/node_modules/puppeteer/lib/ExecutionContext.js:48:16)16 at async Object.timeField (/Users/username/taiko/lib/taiko.js:1018:29)17 at async Object.<anonymous> (/Users/username/taiko/test.js:7:14)18const {timeField, openBrowser, goto, write, closeBrowser} = require('taiko');19(async () => {20 try {21 await openBrowser();22 await goto("localhost:8080");23 await write("test", into(timeField({id:"time"})));24 } catch (e) {25 console.error(e);26 } finally {27 await closeBrowser();28 }29})();

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run taiko automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful